diff options
| author | Jean-Philippe Bruyère <jp_bruyere@hotmail.com> | 2021-09-27 05:27:06 +0000 |
|---|---|---|
| committer | Jean-Philippe Bruyère <jp_bruyere@hotmail.com> | 2021-09-28 08:33:35 +0000 |
| commit | 942155da0d427b7c4f98fa91da390461b5f1dd9f (patch) | |
| tree | 486e26368ac109dfdef99b52fb22f547a4e87525 | |
| parent | c0fc101f87d4b4b55dbe7958d68e2a416e191217 (diff) | |
wip
10 files changed, 413 insertions, 16 deletions
diff --git a/Crow/src/Widgets/DirectoryView2.cs b/Crow/src/Widgets/DirectoryView2.cs new file mode 100644 index 00000000..174708d4 --- /dev/null +++ b/Crow/src/Widgets/DirectoryView2.cs @@ -0,0 +1,157 @@ +// Copyright (c) 2013-2020 Jean-Philippe Bruyère <jp_bruyere@hotmail.com> +// +// This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT) + +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.IO; +using System.Linq; + +namespace Crow +{ + public enum DirectoryViewStyle { + Icons, + Detailed, + Compact, + } + /// <summary> + /// templated directory viewer + /// </summary> + public class DirectoryView2 : TemplatedGroup + { + #region CTOR + protected DirectoryView2() {} + public DirectoryView2 (Interface iface, string style = null) : base (iface, style) { } + #endregion + + string currentDirectory = "/"; + bool showFiles, showHidden; + string fileMask = "*.*"; + int iconSize; + DirectoryViewStyle viewStyle; + + [DefaultValue(DirectoryViewStyle.Icons)] + public virtual DirectoryViewStyle ViewStyle { + get => viewStyle; + set { + if (viewStyle == value) + return; + viewStyle = value; + NotifyValueChangedAuto (viewStyle); + updateItemTemplates (); + } + } + [DefaultValue(32)] + public virtual int IconSize { + get => iconSize; + set { + if (iconSize == value) + return; + iconSize = value; + NotifyValueChangedAuto (iconSize); + NotifyValueChanged ("IconSizeMeasure", new Measure(iconSize, Unit.Pixel)); + updateItemTemplates (); + } + } + //public Measure IconSizeMeasure => new Measure(iconSize, Unit.Pixel); + [DefaultValue(true)] + public virtual bool ShowFiles { + get { return showFiles; } + set { + if (showFiles == value) + return; + showFiles = value; + NotifyValueChangedAuto (showFiles); + NotifyValueChanged ("FileSystemEntries", FileSystemEntries); + } + } + [DefaultValue(false)] + public virtual bool ShowHidden { + get { return showHidden; } + set { + if (showHidden == value) + return; + showHidden = value; + NotifyValueChangedAuto (showHidden); + NotifyValueChanged ("FileSystemEntries", FileSystemEntries); + } + } + [DefaultValue("*.*")] + public virtual string FileMask { + get { return fileMask; } + set { + if (fileMask == value) + return; + fileMask = value; + NotifyValueChangedAuto (fileMask); + NotifyValueChanged ("FileSystemEntries", FileSystemEntries); + } + } + [DefaultValue(".")] + public virtual string CurrentDirectory { + get { return currentDirectory; } + set { + if (currentDirectory == value) + return; + currentDirectory = value; + NotifyValueChangedAuto (currentDirectory); + NotifyValueChanged ("FileSystemEntries", FileSystemEntries); + updateFileSystemEntries(); + } + } + [XmlIgnore]public FileSystemInfo[] FileSystemEntries { + get { + try { + if (string.IsNullOrEmpty(CurrentDirectory)) + return null; + DirectoryInfo di = new DirectoryInfo(CurrentDirectory); + List<FileSystemInfo> fi = new List<FileSystemInfo> (di.GetDirectories()); + if (showFiles && !string.IsNullOrEmpty(fileMask)) + fi.AddRange(di.GetFiles(fileMask)); + return showHidden ? + fi.OrderBy(f=>f.Attributes).ThenBy(f=>f.Name).ToArray() : + fi.Where(f=>!f.Attributes.HasFlag (FileAttributes.Hidden)).OrderBy (f => f.Attributes).ThenBy (f => f.Name).ToArray(); + } catch (Exception ex) { + System.Diagnostics.Debug.WriteLine (ex.ToString ()); + return null; + } + } + } + //set template and itemTemplates depending on view configuration + void updateItemTemplates () { + return; + ItemTemplate = fileItemTemplates; + } + void updateFileSystemEntries () { + + } + string fileItemTemplates => @" + +<ItemTemplate DataType='System.IO.FileInfo'> + <ListItem Fit='true' + BubbleEvents='All' + Selected = '{Background=${ControlHighlight}}' + Unselected = '{Background=Transparent}'> + <HorizontalStack> + <Image Margin='2' Width='ICON_SIZE' Height='ICON_SIZE' Path='${FileIcon}'/> + <Label Text='{Name}' /> + </HorizontalStack> + </ListItem> +</ItemTemplate> +<ItemTemplate DataType='System.IO.DirectoryInfo'> + <ListItem Fit='true' + BubbleEvents='All' + Selected = '{Background=${ControlHighlight}}' + Unselected = '{Background=Transparent}'> + <HorizontalStack> + <Image Margin='2' Width='ICON_SIZE' Height='ICON_SIZE' Path='${FolderIcon}'/> + <Label Text='{Name}' /> + <!--<Label Text='{LastAccessTime}' />--> + </HorizontalStack> + </ListItem> +</ItemTemplate> +".Replace ("ICON_SIZE", iconSize.ToString()); + } +} + diff --git a/Crow/src/Widgets/FileDialog.cs b/Crow/src/Widgets/FileDialog.cs index 302818bf..9438597e 100644 --- a/Crow/src/Widgets/FileDialog.cs +++ b/Crow/src/Widgets/FileDialog.cs @@ -41,7 +41,7 @@ namespace Crow } [DefaultValue("/home")] public virtual string CurrentDirectory { - get { return curDir; } + get => curDir; set { if (curDir == value) return; @@ -53,7 +53,7 @@ namespace Crow [DefaultValue("*")] public virtual string SearchPattern { - get { return searchPattern; } + get => searchPattern; set { if (searchPattern == value) return; @@ -64,7 +64,7 @@ namespace Crow } [DefaultValue(false)] public virtual bool ShowHidden { - get { return showHidden; } + get => showHidden; set { if (showHidden == value) return; @@ -74,7 +74,7 @@ namespace Crow } [DefaultValue(true)] public virtual bool ShowFiles { - get { return showFiles; } + get => showFiles; set { if (showFiles == value) return; @@ -83,7 +83,7 @@ namespace Crow } } public string SelectedFile { - get { return _selectedFile; } + get => _selectedFile; set { if (value == _selectedFile) return; @@ -92,7 +92,7 @@ namespace Crow } } public string SelectedDirectory { - get { return _selectedDir; } + get => _selectedDir; set { if (value == _selectedDir) return; diff --git a/Samples/common/ui/Interfaces/Divers/fitListWithStretchedItems.crow b/Samples/common/ui/Interfaces/Divers/fitListWithStretchedItems.crow index f159a6b2..73693535 100644 --- a/Samples/common/ui/Interfaces/Divers/fitListWithStretchedItems.crow +++ b/Samples/common/ui/Interfaces/Divers/fitListWithStretchedItems.crow @@ -1,5 +1,5 @@ <?xml version="1.0"?> -<ListBox Data="{TestList}" Width="Fit" Focusable="true" > +<ListBox Data="{TestList}" Width="Fit" Focusable="true" Foreground="Red" > <Template> <Scroller Name="ItemsScroller" Height="Stretched" Background="Onyx" Margin="10"> <VerticalStack Name="ItemsContainer" Orientation="Horizontal" VerticalAlignment="Top" Height="Fit" Background="Grey" Margin="20"/> @@ -10,7 +10,7 @@ <ListItem Width="Stretched" Margin="1" CornerRadius="5" Selected="{Background=Yellow}" Unselected="{Background=Transparent}"> - <Label Text="{}" TextAlignment="Center" Font="mono, 9" Foreground="Black" Margin="6" Background="{}" Width="Stretched" /> + <Label Text="{}" TextAlignment="Center" Font="mono, 9" Foreground="{Foreground}" Margin="6" Background="{}" Width="Stretched" /> </ListItem> </ItemTemplate> diff --git a/Samples/common/ui/Interfaces/Experimental/directoryView2.crow b/Samples/common/ui/Interfaces/Experimental/directoryView2.crow new file mode 100644 index 00000000..8035f749 --- /dev/null +++ b/Samples/common/ui/Interfaces/Experimental/directoryView2.crow @@ -0,0 +1,40 @@ +<DirectoryView2 CurrentDirectory="/mnt/devel" Data="{/FileSystemEntries}"> + <Template> + <VerticalStack> + <Spinner Value="{²./IconSize}" SmallIncrement="1" LargeIncrement="1"/> + <HorizontalStack Background="Grey" Margin="5"> + <Scroller Name="scroller1"> + <Wrapper Orientation="Vertical" Height="Fit" VerticalAlignment="Top" + Name="ItemsContainer" Margin="0" Spacing="2"/> + </Scroller> + <ScrollBar Name="scrollbar1" Orientation="Vertical" + Value="{²../scroller1.ScrollY}" Maximum="{../scroller1.MaxScrollY}" + CursorRatio="{../scroller1.ChildHeightRatio}" + LargeIncrement="{../scroller1.PageHeight}" SmallIncrement="30" + Width="14" /> + </HorizontalStack> + </VerticalStack> + </Template> + <ItemTemplate DataType="System.IO.FileInfo"> + <ListItem Width="70" Height="60" + BubbleEvents="All" Tooltip="{Name}" + Selected = "{Background=${ControlHighlight}}" + Unselected = "{Background=Transparent}"> + <VerticalStack> + <Image Margin="8" Width="Fit" Height="Stretched" Path="${FileIcon}" Scaled="true"/> + <Label Text="{Name}" Background="Jet" Width="Stretched" TextAlignment="Center" Multiline="true" Font="sans,9" /> + </VerticalStack> + </ListItem> + </ItemTemplate> + <ItemTemplate DataType="System.IO.DirectoryInfo"> + <ListItem Width="90" Height="60" + BubbleEvents="All" Tooltip="{Name}" + Selected = "{Background=${ControlHighlight}}" + Unselected = "{Background=Transparent}"> + <VerticalStack> + <Image Margin="0" Width="Fit" Height="Stretched" Path="${FolderIcon}" Scaled="true"/> + <Label Text="{Name}" Background="Jet" Width="Stretched" TextAlignment="Center" Multiline="true" Font="sans,9"/> + </VerticalStack> + </ListItem> + </ItemTemplate> +</DirectoryView2>
\ No newline at end of file diff --git a/Samples/common/ui/Interfaces/Experimental/directoryView3.crow b/Samples/common/ui/Interfaces/Experimental/directoryView3.crow new file mode 100644 index 00000000..1dd1d88d --- /dev/null +++ b/Samples/common/ui/Interfaces/Experimental/directoryView3.crow @@ -0,0 +1,35 @@ +<DirectoryView2 CurrentDirectory="/mnt/devel" Data="{/FileSystemEntries}"> + <Template> + <VerticalStack> + <Spinner Value="{²./IconSize}" SmallIncrement="1" LargeIncrement="1"/> + <VerticalStack Background="Grey" Margin="5"> + <Scroller Name="scroller1"> + <Wrapper Orientation="Horizontal" Height="Stretched" Width="Fit" HorizontalAlignment="Left" + Name="ItemsContainer" Margin="0" Spacing="2"/> + </Scroller> + </VerticalStack> + </VerticalStack> + </Template> + <ItemTemplate DataType="System.IO.FileInfo"> + <ListItem Width="Fit" Height="Fit" + BubbleEvents="All" Tooltip="{Name}" + Selected = "{Background=${ControlHighlight}}" + Unselected = "{Background=Transparent}"> + <HorizontalStack Spacing="5"> + <Image Margin="0" Width="16" Height="16" Path="${FileIcon}" Scaled="true"/> + <Label Text="{Name}" Width="Fit" Font="sans,9" /> + </HorizontalStack> + </ListItem> + </ItemTemplate> + <ItemTemplate DataType="System.IO.DirectoryInfo"> + <ListItem Width="Fit" Height="Fit" + BubbleEvents="All" Tooltip="{Name}" + Selected = "{Background=${ControlHighlight}}" + Unselected = "{Background=Transparent}"> + <HorizontalStack Spacing="5"> + <Image Margin="0" Width="16" Height="16" Path="${FolderIcon}" Scaled="true"/> + <Label Text="{Name}" Width="Fit" Font="sans,9"/> + </HorizontalStack> + </ListItem> + </ItemTemplate> +</DirectoryView2>
\ No newline at end of file diff --git a/Samples/common/ui/Interfaces/Experimental/directoryView4.crow b/Samples/common/ui/Interfaces/Experimental/directoryView4.crow new file mode 100644 index 00000000..ee3e8b1b --- /dev/null +++ b/Samples/common/ui/Interfaces/Experimental/directoryView4.crow @@ -0,0 +1,40 @@ +<DirectoryView2 CurrentDirectory="/mnt/devel" Data="{/FileSystemEntries}"> + <Template> + <VerticalStack> + <Spinner Value="{²./IconSize}" SmallIncrement="1" LargeIncrement="1"/> + <VerticalStack Background="Grey" Margin="5"> + <Scroller Name="scroller1"> + <VerticalStack Height="Fit" Width="Stretched" VerticalAlignment="Top" + Name="ItemsContainer" Margin="0" Spacing="2"/> + </Scroller> + </VerticalStack> + </VerticalStack> + </Template> + <ItemTemplate DataType="System.IO.FileInfo"> + <ListItem Width="Stretched" Height="Fit" + BubbleEvents="All" Tooltip="{Name}" + Selected = "{Background=${ControlHighlight}}" + Unselected = "{Background=Transparent}"> + <HorizontalStack Spacing="5"> + <Image Margin="0" Width="16" Height="16" Path="${FileIcon}" Scaled="true"/> + <Label Text="{Name}" Width="Stretched" Font="sans,9" /> + <Label Text="{Length}" Width="Fit" Font="sans,9"/> + <Label Text="{Attributes}" Width="Fit" Font="sans,9"/> + <Label Text="{LastAccessTime}" Width="Fit" Font="sans,9"/> + </HorizontalStack> + </ListItem> + </ItemTemplate> + <ItemTemplate DataType="System.IO.DirectoryInfo"> + <ListItem Width="Stretched" Height="Fit" + BubbleEvents="All" Tooltip="{Name}" + Selected = "{Background=${ControlHighlight}}" + Unselected = "{Background=Transparent}"> + <HorizontalStack Spacing="5"> + <Image Margin="0" Width="16" Height="16" Path="${FolderIcon}" Scaled="true"/> + <Label Text="{Name}" Width="Stretched" Font="sans,9"/> + <Label Text="{Attributes}" Width="Fit" Font="sans,9"/> + <Label Text="{LastAccessTime}" Width="Fit" Font="sans,9"/> + </HorizontalStack> + </ListItem> + </ItemTemplate> +</DirectoryView2>
\ No newline at end of file diff --git a/Samples/common/ui/Interfaces/Experimental/directoryView5.crow b/Samples/common/ui/Interfaces/Experimental/directoryView5.crow new file mode 100644 index 00000000..62b743ab --- /dev/null +++ b/Samples/common/ui/Interfaces/Experimental/directoryView5.crow @@ -0,0 +1,36 @@ +<DirectoryView2 CurrentDirectory="/mnt/devel" Data="{/FileSystemEntries}"> + <Template> + <VerticalStack> + <Spinner Value="{²./IconSize}" SmallIncrement="1" LargeIncrement="1"/> + <VerticalStack Background="DarkGrey" Margin="0"> + <Scroller Name="scroller1"> + <Table Columns=",20;Name,Stretched;Size,100;Accessed,Fit" Height="Fit" Width="Stretched" VerticalAlignment="Top" + Name="ItemsContainer" Margin="0" Spacing="0" RowsMargin="0" ColumnSpacing="10" + HorizontalLineWidth="0" VerticalLineWidth="1" /> + </Scroller> + </VerticalStack> + </VerticalStack> + </Template> + <ItemTemplate DataType="System.IO.DirectoryInfo"> + <TableRow Width="Stretched" Height="Fit" Focusable="true" + BubbleEvents="All" Tooltip="{Name}" + Selected="{Background=${ControlHighlight}}" + Unselected="{Background=Transparent}"> + <Image Width="Stretched" Height="Stretched" Path="${FolderIcon}" Margin="0" /> + <Label Text="{Name}" Width="Fit" Font="sans,11" Margin="3"/> + <Label Text="" Font="sans,9"/> + <Label Text="{LastAccessTime}" Font="sans,9"/> + </TableRow> + </ItemTemplate> + <ItemTemplate DataType="System.IO.FileInfo"> + <TableRow Width="Stretched" Height="Fit" Focusable="true" + BubbleEvents="All" Tooltip="{Name}" + Selected="{Background=${ControlHighlight}}" + Unselected="{Background=Transparent}"> + <Image Width="Stretched" Height="Stretched" Path="${FileIcon}" Margin="2" /> + <Label Text="{Name}" Width="Fit" Font="sans,11" Margin="3"/> + <Label Text="{Length}" Font="sans,9" TextAlignment="Right"/> + <Label Text="{LastAccessTime}" Font="sans,9"/> + </TableRow> + </ItemTemplate> +</DirectoryView2>
\ No newline at end of file diff --git a/Samples/common/ui/Interfaces/Experimental/fileDialog.crow b/Samples/common/ui/Interfaces/Experimental/fileDialog.crow index 90f9c70c..977cbf31 100644 --- a/Samples/common/ui/Interfaces/Experimental/fileDialog.crow +++ b/Samples/common/ui/Interfaces/Experimental/fileDialog.crow @@ -12,6 +12,95 @@ <Label Text="{ActiveWidget}" Font="mono, 8"/> </HorizontalStack> <Container> - <FileDialog Focusable="true" Resizable="true"/> + <FileDialog Focusable="true" Resizable="true"> + <Template> + <Border Name="SizeHandle" Style="winBorder" CornerRadius="{./CornerRadius}" Background="{./Background}"> + <VerticalStack Spacing="0"> + <HorizontalStack Background="${WindowTitleBarBackground}" Margin="0" Spacing="0" Height="Fit"> + <Widget Width="5"/> + <Image Margin="1" Width="12" Height="12" Path="{./Icon}"/> + <Label Name="MoveHandle" Width="Stretched" Foreground="${WindowTitleBarForeground" Margin="2" TextAlignment="Center" Text="{./Caption}" /> + <Border CornerRadius="0" BorderWidth="1" Foreground="Transparent" Height="12" Width="12" + MouseEnter="{Foreground=White}" MouseLeave="{Foreground=Transparent}"> + <Image Focusable="true" Name="Image" Margin="0" Width="Stretched" Height="Stretched" Path="#Crow.Icons.exit2.svg" + MouseClick="./onQuitPress"/> + </Border> + <Widget Width="5"/> + </HorizontalStack> + <Container Name="Content" MinimumSize="50,50" Background="Jet"> + <VerticalStack Spacing="2" Margin="1"> + <HorizontalStack Height="Fit" Margin="2"> + <Button MinimumSize="1,1" Fit="true" Caption="Up" MouseClick="./goUpDirClick"> + <Image Margin="2" Width="18" Height="18" + Path="#Crow.Icons.level-up.svg"/> + </Button> + <TextBox Style="TxtInFileDialog" Text="{²./CurrentDirectory}" Margin="3"/> + </HorizontalStack> + <DirectoryView ShowHidden="{²../cbShowHidden.IsChecked}" FileMask="{²../txtFileMask.Text}" + ShowFiles="{²../cbShowFiles.IsChecked}" Name="fv" CurrentDirectory="{./CurrentDirectory}" + SelectedItemChanged="./onFVSelectedItemChanged" + Width="100%" Margin="1" MouseDoubleClick="./onFileSelectDblClick"> + <Template> + <ListBox Name="fileView" Data="{./FileSystemEntries}" + SelectedItemChanged="./onSelectedItemChanged"> + <Template> + <HorizontalStack Background="Grey"> + <Scroller Name="scroller1"> + <VerticalStack Height="Fit" VerticalAlignment="Top" + Name="ItemsContainer" Margin="2" Spacing="1"/> + </Scroller> + <ScrollBar Name="scrollbar1" Orientation="Vertical" + Value="{²../scroller1.ScrollY}" Maximum="{../scroller1.MaxScrollY}" + CursorRatio="{../scroller1.ChildHeightRatio}" + LargeIncrement="{../scroller1.PageHeight}" SmallIncrement="30" + Width="14" /> + </HorizontalStack> + </Template> + <ItemTemplate> + <Widget Height="16" Background="Red"/> + </ItemTemplate> + <ItemTemplate DataType="System.IO.FileInfo"> + <ListItem Height="Fit" + BubbleEvents="All" + Selected = "{Background=${ControlHighlight}}" + Unselected = "{Background=Transparent}"> + <HorizontalStack Spacing="5"> + <Image Width="20" Height="20" Path="#Crow.Icons.file.svg"/> + <Label Margin="2" Text="{Name}" Width="Stretched"/> + </HorizontalStack> + </ListItem> + </ItemTemplate> + <ItemTemplate DataType="System.IO.DirectoryInfo"> + <ListItem Height="Fit" + BubbleEvents="All" + Selected = "{Background=${ControlHighlight}}" + Unselected = "{Background=Transparent}"> + <HorizontalStack Spacing="5"> + <Image Width="20" Height="20" Path="#Crow.Icons.folder.svg"/> + <Label Margin="2" Text="{Name}" Width="Stretched"/> + <Label Margin="2" Text="{LastAccessTime}" /> + </HorizontalStack> + </ListItem> + </ItemTemplate> + </ListBox> + </Template> + </DirectoryView> + <HorizontalStack Height="Fit"> + <TextBox Style="TxtInFileDialog" Text="{²./SelectedFile}"/> + <TextBox Style="TxtInFileDialog" Width="50" Name="txtFileMask" Text="{²./SearchPattern}"/> + </HorizontalStack> + <HorizontalStack Height="Fit" Margin="2" Spacing="2"> + <CheckBox Style="CheckBoxAlt" Name="cbShowFiles" Caption="Show Files" IsChecked="{²./ShowFiles}" Width="Fit"/> + <CheckBox Style="CheckBoxAlt" Name="cbShowHidden" Caption="Show Hidden" IsChecked="{²./ShowHidden}" Width="Fit"/> + <Widget Width="Stretched"/> + <Button Caption="Ok" Command="{./CMDOk}"/> + <Button Caption="Cancel" Command="{./CMDCancel}"/> + </HorizontalStack> + </VerticalStack> + </Container> + </VerticalStack> + </Border> + </Template> + </FileDialog> </Container> </VerticalStack>
\ No newline at end of file diff --git a/Samples/common/ui/Interfaces/Experimental/tabView1.crow b/Samples/common/ui/Interfaces/Experimental/tabView1.crow index 773ec4fe..7dfcede8 100644 --- a/Samples/common/ui/Interfaces/Experimental/tabView1.crow +++ b/Samples/common/ui/Interfaces/Experimental/tabView1.crow @@ -1,4 +1,4 @@ <TabView> - <GroupBox Caption="test" Background="Red"/> - <GroupBox Caption="test" Background="Blue"/> + <GroupBox Name="test" Background="Red"/> + <GroupBox Name="test2" Background="Blue"/> </TabView>
\ No newline at end of file diff --git a/Samples/common/ui/Interfaces/Experimental/tabviewWithScrollTabName.crow b/Samples/common/ui/Interfaces/Experimental/tabviewWithScrollTabName.crow index 4b29646e..6fc5ba47 100644 --- a/Samples/common/ui/Interfaces/Experimental/tabviewWithScrollTabName.crow +++ b/Samples/common/ui/Interfaces/Experimental/tabviewWithScrollTabName.crow @@ -1,12 +1,9 @@ <TabView Orientation="Horizontal"> <Template> - <GenericStack Orientation="{./OppositeOrientation}" Spacing="0" Background="{./Background}"> + <VerticalStack Spacing="0" Background="{./Background}"> <ListBox Data="{./Items}" Height="Fit" HorizontalAlignment="Left" VerticalAlignment="Top" SelectedItem="{²./SelectedItem}"> <Template> <VerticalStack Spacing="0" > - <Scroller Name="ItemsScroller" > - <GenericStack Orientation="{../../../../../Orientation}" Width="Fit" Name="ItemsContainer" HorizontalAlignment="Left"/> - </Scroller> <ScrollBar Orientation="Horizontal" Foreground="RoyalBlue" Height="6" Width="Stretched" CornerRadius="3" Value="{²../ItemsScroller.ScrollX}" LargeIncrement="{../ItemsScroller.PageWidth}" SmallIncrement="1" @@ -17,6 +14,9 @@ </Container> </Template> </ScrollBar> + <Scroller Name="ItemsScroller" > + <HorizontalStack Width="Fit" Name="ItemsContainer" HorizontalAlignment="Left"/> + </Scroller> </VerticalStack> </Template> <ItemTemplate> @@ -28,7 +28,7 @@ </ItemTemplate> </ListBox> <Group Name="ItemsContainer" /> - </GenericStack> + </VerticalStack> </Template> <GroupBox Name="item 1" Caption="item 1" IsVisible="true" Background="Violet"/> <GroupBox Name="item 2" Caption="item 2" IsVisible="false" Background="CornflowerBlue"/> |