Files icon indicating copy to clipboard operation
Files copied to clipboard

Code Quality: Introduce item template to PaneHolderPage.xaml

Open yaira2 opened this issue 1 year ago • 9 comments

Description

The multipane feature consists of two ModernShellPages and a GridSplitter. The code around this is hard to work with and prevents us from expanding the feature to allow more than two panes. Creating an item template will allow us to create and close panes on demand.

Concerned code

PaneHolderPage.xaml

Gains

  • easier to maintain
  • will allow supporting more than two mains

Requirements

  • use item template instead of hardcoding the right and left pane

Comments

No response

yaira2 avatar Apr 03 '23 20:04 yaira2

What about using BladeView like ColumnsLayout? If we do so, it'd be easier to merge ColumnShellPage and ModernShellPage.

0x5bfa avatar May 06 '24 13:05 0x5bfa

Once there is a template, we can do some testing to figure out the best control.

As a sidenote, isn't BladeView being phased out?

yaira2 avatar May 06 '24 14:05 yaira2

Yeah, they plan to remove. We can make similar one if we plan not to use as well.

Agreed, let’s create a template first.

0x5bfa avatar May 06 '24 15:05 0x5bfa

I did a quick search and I found that we cannot add time template and item repeater to enumerate shell pages as we have sizer in-between.

We seem to have use StackPanel.Children and add UIElements to it. This increases amount of code in code behind but this seems to be a better idea.

Things what we have to interact with are:

  • Add a pane
  • Remove a pane
  • Focus on a pane using accent border color at the bottom.
  • Focus off a pane
  • Support to resize panes

Current GridSpitter is hard to handle since we have to manipulate every interaction, while WCT 8.0's ContentSizer has brilliant feature, which it targets a sizing control internally:

<StackPanel x:Name="LeftPanel" />
<wct:ContentSizer Target="{Binding LeftPanel}" />

This may reduce a certain amount of code and improve maintainability. Also removing the concept of 'left' or 'right' enables user to remove any pane at any time.

0x5bfa avatar May 08 '24 08:05 0x5bfa

We might want to support vertical panes as well in the future.

yaira2 avatar May 08 '24 14:05 yaira2

Let's use StackPanel.Orientation then

0x5bfa avatar May 08 '24 16:05 0x5bfa

There can be a scenario with 4 panes, two on top, and two on bottom.

yaira2 avatar May 08 '24 19:05 yaira2

Oh are we gonna support different orientations?

+-----------+-----------+
|           |           |
|  Top (L)  |  Top (R)  |
|           |           |
+-----------+-----------+
|           |           |
| Bottom(L) | Bottom(R) |
|           |           |
+-----------+-----------+

0x5bfa avatar May 08 '24 23:05 0x5bfa

After discussing Discord, we'll only support one orientation at a time. It's also worth pointing out that we're not actually adding support for different orientations right now, we're only bringing this up in order to prevent extra work in the future.

yaira2 avatar May 09 '24 14:05 yaira2