1- <?xml version =" 1.0" encoding =" utf-8" ?>
2- <UserControl x : Class =" Daqifi.Desktop.View.DeviceLogsView"
3- xmlns =" http://schemas.microsoft.com/winfx/2006/xaml/presentation"
4- xmlns : x =" http://schemas.microsoft.com/winfx/2006/xaml"
5- xmlns : mc =" http://schemas.openxmlformats.org/markup-compatibility/2006"
6- xmlns : d =" http://schemas.microsoft.com/expression/blend/2008"
7- xmlns : Controls =" clr-namespace:MahApps.Metro.Controls;assembly=MahApps.Metro"
8- xmlns : iconPacks =" http://metro.mahapps.com/winfx/xaml/iconpacks"
9- xmlns : converters =" clr-namespace:Daqifi.Desktop.Converters"
10- mc : Ignorable =" d"
11- d : DesignHeight =" 450" d : DesignWidth =" 800" >
12- <UserControl .Resources>
13- <converters : ConnectionTypeToColorConverter x : Key =" ConnectionTypeToColorConverter" />
14- <converters : NotNullToVisibilityConverter x : Key =" NotNullToVisibilityConverter" />
15- <BooleanToVisibilityConverter x : Key =" BoolToVis" />
16- </UserControl .Resources>
17- <Grid >
18- <Grid .RowDefinitions>
19- <RowDefinition Height =" Auto" />
20- <RowDefinition Height =" *" />
21- </Grid .RowDefinitions>
22-
23- <!-- Device Selection -->
24- <Grid Grid.Row=" 0" Margin =" 0,0,0,10" >
25- <Grid .RowDefinitions>
26- <RowDefinition Height =" Auto" />
27- <RowDefinition Height =" Auto" />
28- </Grid .RowDefinitions>
29- <Grid .ColumnDefinitions>
30- <ColumnDefinition Width =" Auto" />
31- <ColumnDefinition Width =" *" />
32- <ColumnDefinition Width =" Auto" />
33- </Grid .ColumnDefinitions>
34-
35- <!-- Device Selection Row -->
36- <TextBlock Text =" Device:"
37- Grid.Row=" 0"
38- VerticalAlignment =" Center"
39- Margin =" 0,0,10,0" />
40-
41- <ComboBox Grid.Row=" 0"
42- Grid.Column=" 1"
43- ItemsSource =" {Binding ConnectedDevices}"
44- SelectedItem =" {Binding SelectedDevice}"
45- DisplayMemberPath =" DeviceSerialNo"
46- Margin =" 0,0,10,0" />
47-
48- <Button Grid.Row=" 0"
49- Grid.Column=" 2"
50- Command =" {Binding RefreshFilesCommand}"
51- ToolTip =" {Binding ConnectionTypeMessage}"
52- IsEnabled =" {Binding CanAccessSdCard}" >
53- <StackPanel Orientation =" Horizontal" >
54- <iconPacks : PackIconMaterial Kind =" Refresh" Margin =" 0,0,5,0" />
55- <TextBlock Text =" Refresh Files" />
56- </StackPanel >
57- </Button >
58-
59- <!-- Connection Status Row -->
60- <TextBlock Grid.Row=" 1"
61- Grid.Column=" 0"
62- Grid.ColumnSpan=" 3"
63- Text =" {Binding ConnectionTypeMessage}"
64- Margin =" 0,5,0,0"
65- FontSize =" 14"
66- FontWeight =" SemiBold"
67- Foreground =" {Binding SelectedDevice.ConnectionType, Converter={StaticResource ConnectionTypeToColorConverter}}"
68- HorizontalAlignment =" Left"
69- Visibility =" {Binding SelectedDevice, Converter={StaticResource NotNullToVisibilityConverter}}" />
70- </Grid >
71-
72- <!-- Device Files List -->
73- <Grid Grid.Row=" 1" >
74- <ListView ItemsSource =" {Binding DeviceFiles}"
75- Background =" Transparent"
76- BorderThickness =" 0"
77- IsEnabled =" {Binding CanAccessSdCard}" >
78- <ListView .View>
79- <GridView >
80- <GridViewColumn Header =" Name" Width =" 300" >
81- <GridViewColumn .CellTemplate>
82- <DataTemplate >
83- <TextBlock Text =" {Binding FileName}" />
84- </DataTemplate >
85- </GridViewColumn .CellTemplate>
86- </GridViewColumn >
87- <GridViewColumn Header =" Created" Width =" 200" >
88- <GridViewColumn .CellTemplate>
89- <DataTemplate >
90- <TextBlock Text =" {Binding CreatedDate, StringFormat=\{0:g\}}" />
91- </DataTemplate >
92- </GridViewColumn .CellTemplate>
93- </GridViewColumn >
94- </GridView >
95- </ListView .View>
96- </ListView >
97- </Grid >
98-
99- <!-- Loading Overlay -->
100- <Grid Grid.RowSpan=" 2" Visibility =" {Binding IsBusy, Converter={StaticResource BoolToVis}}" >
101- <Rectangle Fill =" White" Opacity =" 0.75" IsHitTestVisible =" False" />
102- <StackPanel VerticalAlignment =" Center" >
103- <Controls : ProgressRing IsActive =" {Binding IsBusy}" />
104- <Label Content =" {Binding BusyMessage}"
105- FontSize =" 14"
106- HorizontalContentAlignment =" Center"
107- Foreground =" #CC119EDA"
108- FontWeight =" Bold" />
109- </StackPanel >
110- </Grid >
111- </Grid >
1+ <?xml version =" 1.0" encoding =" utf-8" ?>
2+ <UserControl x : Class =" Daqifi.Desktop.View.DeviceLogsView"
3+ xmlns =" http://schemas.microsoft.com/winfx/2006/xaml/presentation"
4+ xmlns : x =" http://schemas.microsoft.com/winfx/2006/xaml"
5+ xmlns : mc =" http://schemas.openxmlformats.org/markup-compatibility/2006"
6+ xmlns : d =" http://schemas.microsoft.com/expression/blend/2008"
7+ xmlns : Controls =" clr-namespace:MahApps.Metro.Controls;assembly=MahApps.Metro"
8+ xmlns : iconPacks =" http://metro.mahapps.com/winfx/xaml/iconpacks"
9+ xmlns : converters =" clr-namespace:Daqifi.Desktop.Converters"
10+ mc : Ignorable =" d"
11+ d : DesignHeight =" 450" d : DesignWidth =" 800" >
12+ <UserControl .Resources>
13+ <converters : ConnectionTypeToColorConverter x : Key =" ConnectionTypeToColorConverter" />
14+ <converters : NotNullToVisibilityConverter x : Key =" NotNullToVisibilityConverter" />
15+ <BooleanToVisibilityConverter x : Key =" BoolToVis" />
16+ </UserControl .Resources>
17+ <Grid >
18+ <Grid .RowDefinitions>
19+ <RowDefinition Height =" Auto" />
20+ <RowDefinition Height =" *" />
21+ </Grid .RowDefinitions>
22+
23+ <!-- Device Selection -->
24+ <Grid Grid.Row=" 0" Margin =" 0,0,0,10" >
25+ <Grid .RowDefinitions>
26+ <RowDefinition Height =" Auto" />
27+ <RowDefinition Height =" Auto" />
28+ </Grid .RowDefinitions>
29+ <Grid .ColumnDefinitions>
30+ <ColumnDefinition Width =" Auto" />
31+ <ColumnDefinition Width =" *" />
32+ <ColumnDefinition Width =" Auto" />
33+ </Grid .ColumnDefinitions>
34+
35+ <!-- Device Selection Row -->
36+ <TextBlock Text =" Device:"
37+ Grid.Row=" 0"
38+ VerticalAlignment =" Center"
39+ Margin =" 0,0,10,0" />
40+
41+ <ComboBox Grid.Row=" 0"
42+ Grid.Column=" 1"
43+ ItemsSource =" {Binding ConnectedDevices}"
44+ SelectedItem =" {Binding SelectedDevice}"
45+ DisplayMemberPath =" DeviceSerialNo"
46+ Margin =" 0,0,10,0" />
47+
48+ <Button Grid.Row=" 0"
49+ Grid.Column=" 2"
50+ Command =" {Binding RefreshFilesCommand}"
51+ ToolTip =" {Binding ConnectionTypeMessage}"
52+ IsEnabled =" {Binding CanAccessSdCard}" >
53+ <StackPanel Orientation =" Horizontal" >
54+ <iconPacks : PackIconMaterial Kind =" Refresh" Margin =" 0,0,5,0" />
55+ <TextBlock Text =" Refresh Files" />
56+ </StackPanel >
57+ </Button >
58+
59+ <!-- Connection Status Row -->
60+ <TextBlock Grid.Row=" 1"
61+ Grid.Column=" 0"
62+ Grid.ColumnSpan=" 3"
63+ Text =" {Binding ConnectionTypeMessage}"
64+ Margin =" 0,5,0,0"
65+ FontSize =" 14"
66+ FontWeight =" SemiBold"
67+ Foreground =" {Binding SelectedDevice.ConnectionType, Converter={StaticResource ConnectionTypeToColorConverter}}"
68+ HorizontalAlignment =" Left"
69+ Visibility =" {Binding SelectedDevice, Converter={StaticResource NotNullToVisibilityConverter}}" />
70+ </Grid >
71+
72+ <!-- Device Files List -->
73+ <Grid Grid.Row=" 1" >
74+ <ListView ItemsSource =" {Binding DeviceFiles}"
75+ Background =" Transparent"
76+ BorderThickness =" 0"
77+ IsEnabled =" {Binding CanAccessSdCard}" >
78+ <ListView .View>
79+ <GridView >
80+ <GridViewColumn Header =" Name" Width =" 300" >
81+ <GridViewColumn .CellTemplate>
82+ <DataTemplate >
83+ <TextBlock Text =" {Binding FileName}" />
84+ </DataTemplate >
85+ </GridViewColumn .CellTemplate>
86+ </GridViewColumn >
87+ <GridViewColumn Header =" Created" Width =" 200" >
88+ <GridViewColumn .CellTemplate>
89+ <DataTemplate >
90+ <TextBlock Text =" {Binding CreatedDate, StringFormat=\{0:g\}}" />
91+ </DataTemplate >
92+ </GridViewColumn .CellTemplate>
93+ </GridViewColumn >
94+ </GridView >
95+ </ListView .View>
96+ </ListView >
97+ </Grid >
98+
99+ <!-- Loading Overlay -->
100+ <Grid Grid.RowSpan=" 2" Visibility =" {Binding IsBusy, Converter={StaticResource BoolToVis}}" >
101+ <Rectangle Fill =" White" Opacity =" 0.75" IsHitTestVisible =" False" />
102+ <StackPanel VerticalAlignment =" Center" >
103+ <Controls : ProgressRing IsActive =" {Binding IsBusy}" />
104+ <Label Content =" {Binding BusyMessage}"
105+ FontSize =" 14"
106+ HorizontalContentAlignment =" Center"
107+ Foreground =" #CC119EDA"
108+ FontWeight =" Bold" />
109+ </StackPanel >
110+ </Grid >
111+ </Grid >
112112</UserControl >
0 commit comments