Skip to content
5 changes: 4 additions & 1 deletion Daqifi.Desktop/Loggers/LoggingManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -352,13 +352,16 @@ public List<Profile> LoadProfilesFromXml()
MacAddress = (string)d.Element("MACAddress"),
DeviceSerialNo = (string)d.Element("DeviceSerialNo"),
SamplingFrequency = (int)d.Element("SamplingFrequency"),
// The writer omits <Channels> when the device has no active channels
// (see UpdateProfileInXml / AddAndRemoveProfileXml). Default to an empty
// list so downstream code can call .Where/.Select without a null check.
Channels = d.Element("Channels")?.Elements("Channel").Select(c => new ProfileChannel
{
Name = (string)c.Element("Name"),
Type = (string)c.Element("Type"),
IsChannelActive = (bool)c.Element("IsActive"),
SerialNo = (string)d.Element("DeviceSerialNo")
}).ToList()
}).ToList() ?? []
}).ToList())
}).ToList();

Expand Down
84 changes: 1 addition & 83 deletions Daqifi.Desktop/MainWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -258,9 +258,6 @@
<!-- Live Graph Flyout -->
<flyouts:LiveGraphFlyout DataContext="{Binding DataContext, RelativeSource={RelativeSource AncestorType=controls:MetroWindow}}"/>

<!-- Update Profile Flyout -->
<flyouts:UpdateProfileFlyout DataContext="{Binding DataContext, RelativeSource={RelativeSource AncestorType=controls:MetroWindow}}"/>

<!-- Logging Session Settings Flyout-->
<flyouts:LoggedSessionFlyout DataContext="{Binding DataContext, RelativeSource={RelativeSource AncestorType=controls:MetroWindow}}"/>

Expand Down Expand Up @@ -1099,86 +1096,7 @@
<ContentPresenter Content="{Binding}">
<ContentPresenter.ContentTemplate>
<DataTemplate>
<Grid>
<ListView Name="ActiveProfileList" ItemsSource="{Binding Profiles}" SelectionMode="Single" Background="Transparent" BorderThickness="0" SelectedItem="{Binding SelectedProfile, Mode=OneWayToSource}">
<ListView.ItemTemplate>
<DataTemplate>
<Border Height="50">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<StackPanel Grid.Column="0" VerticalAlignment="Center" Orientation="Horizontal">
<Ellipse Width="16" Height="16" VerticalAlignment="Center" Margin="5,5,5,0">
<Ellipse.Style>
<Style TargetType="Ellipse">
<Setter Property="Fill" Value="IndianRed"/>

<Style.Triggers>
<DataTrigger Binding="{Binding IsProfileActive}" Value="True">
<Setter Property="Fill" Value="LightGreen"/>

</DataTrigger>
</Style.Triggers>
</Style>
</Ellipse.Style>
</Ellipse>

<!-- Name Label -->
<Label Content="{Binding Name}" FontWeight="DemiBold" FontSize="16" Padding="5,0,0,0"/>
<Label Content="{Binding CreatedOn}" FontWeight="DemiBold" Foreground="LightGray" FontSize="10" Padding="20,5,0,0"/>

</StackPanel>
<Button Grid.Column="1" HorizontalAlignment="Right" VerticalAlignment="Center" Command="{Binding ElementName=ActiveProfileList, Path=DataContext.OpenProfileSettingsCommand}" CommandParameter="{Binding}" ToolTip="Profile Settings">
<Button.Content>
<iconPacks:PackIconMaterial Kind="Cog" HorizontalAlignment="Center" Height="20" Width="20"/>
</Button.Content>
</Button>
<Button Grid.Column="2" HorizontalAlignment="Right" VerticalAlignment="Center" Command="{Binding ElementName=ActiveProfileList, Path=DataContext.RemoveProfileCommand}" CommandParameter="{Binding}" ToolTip="Delete Profile">
<Button.Content>
<iconPacks:PackIconMaterial Kind="TrashCanOutline" HorizontalAlignment="Center" Height="20" Width="20"/>
</Button.Content>
</Button>
<Button Grid.Column="3" HorizontalAlignment="Right" VerticalAlignment="Center" Command="{Binding ElementName=ActiveProfileList, Path=DataContext.ActivateProfileCommand}" CommandParameter="{Binding}" ToolTip="Active Profile">
<Button.Content>
<iconPacks:PackIconMaterial Kind="CheckCircle" HorizontalAlignment="Center" Height="20" Width="20"/>
</Button.Content>
</Button>
</Grid>
</Border>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
<Border Name="EmptyActiveProfileListLabel" Visibility="Collapsed" HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
<Label HorizontalAlignment="Stretch" HorizontalContentAlignment="Center" VerticalAlignment="Stretch" VerticalContentAlignment="Center">
<Label.Content>
<StackPanel Orientation="Vertical" Width="150" HorizontalAlignment="Center" VerticalAlignment="Center">
<Label Content="No Profiles Data" VerticalContentAlignment="Center" HorizontalContentAlignment="Center"/>
</StackPanel>
</Label.Content>
</Label>
</Border>

<!-- Add profile Button -->
<Button HorizontalAlignment="Right" VerticalAlignment="Bottom" Width="50" Height="50" Command="{Binding ShowAddProfileConfirmationCommand}" Style="{DynamicResource MetroCircleButtonStyle}" Margin="10" Background="#CC119EDA" >
<Button.Content>
<iconPacks:PackIconMaterial Kind="Plus" HorizontalAlignment="Center" Height="20" Width="20" Foreground="White"/>
</Button.Content>
<Button.BitmapEffect>
<DropShadowBitmapEffect Color="Black" Direction="270" Softness="1" ShadowDepth="15" Opacity="0.25" />
</Button.BitmapEffect>
</Button>
</Grid>
<DataTemplate.Triggers>
<DataTrigger Binding="{Binding Profiles.Count}" Value="0">
<Setter TargetName="ActiveProfileList" Property="Visibility" Value="Collapsed"/>
<Setter TargetName="EmptyActiveProfileListLabel" Property="Visibility" Value="Visible"/>
</DataTrigger>
</DataTemplate.Triggers>
<local:ProfilesPane/>
</DataTemplate>
</ContentPresenter.ContentTemplate>
</ContentPresenter>
Expand Down
18 changes: 0 additions & 18 deletions Daqifi.Desktop/View/AddProfileConfirmationDialog.xaml

This file was deleted.

24 changes: 0 additions & 24 deletions Daqifi.Desktop/View/AddProfileConfirmationDialog.xaml.cs

This file was deleted.

82 changes: 0 additions & 82 deletions Daqifi.Desktop/View/AddprofileDialog.xaml

This file was deleted.

81 changes: 0 additions & 81 deletions Daqifi.Desktop/View/AddprofileDialog.xaml.cs

This file was deleted.

Loading
Loading