Something went wrong. Try again.
Modular scanner/radio client and multi-broadcast server. uniscan.dexrn.me
Something went wrong. Try again.
3.9 kB · 58 lines
at main
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758<UserControl xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:device="clr-namespace:UniScan.Client.App.Views.Remote.Device" mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450" x:Class="UniScan.Client.App.Views.Remote.Device.DeviceInfoControl" x:DataType="device:DeviceInfoControlViewModel" x:Name="Root"> <Border Name="DeviceCard" MinHeight="200" Height="{Binding $self.Bounds.Width}" Background="{DynamicResource ButtonBackground}" CornerRadius="5" BorderThickness="2" BorderBrush="{DynamicResource ButtonBorderBrush}" Padding="5"> <Grid RowDefinitions="Auto, *, Auto" RowSpacing="10"> <TextBlock DockPanel.Dock="Top" Grid.Row="0" HorizontalAlignment="Center" Text="{Binding DeviceViewModel.Device.DisplayName}" FontWeight="Bold" FontSize="14" />
<Border Grid.Row="1" BorderThickness="2" BorderBrush="{DynamicResource ButtonBorderBrushPointerOver}" CornerRadius="5"> <Panel> <Panel IsVisible="{Binding DeviceViewModel.Device.Connected}"> <StackPanel Spacing="10" VerticalAlignment="Center" IsVisible="{Binding DeviceViewModel.Device.Subscribed.Value}"> <!-- TODO show mini view --> <Button Command="{Binding ShowDevicePage}" VerticalAlignment="Center" HorizontalAlignment="Center"> Go to page </Button> </StackPanel>
<StackPanel Spacing="10" VerticalAlignment="Center" IsVisible="{Binding DeviceViewModel.Device.Subscribed.Value, Converter={x:Static BoolConverters.Not}}"> <TextBlock Text="Not subscribed" VerticalAlignment="Center" HorizontalAlignment="Center" FontWeight="DemiBold" /> <Button Command="{Binding SubscribeCommand}" VerticalAlignment="Center" HorizontalAlignment="Center"> Subscribe </Button> </StackPanel> </Panel> <Panel IsVisible="{Binding !DeviceViewModel.Device.Connected}"> <TextBlock Text="Device not connected" Foreground="{DynamicResource TextControlForegroundDisabled}" HorizontalAlignment="Center" VerticalAlignment="Center" FontSize="18" FontWeight="Bold" /> </Panel> </Panel> </Border>
<Grid DockPanel.Dock="Bottom" Grid.Row="2" ColumnDefinitions="Auto,*,Auto" ColumnSpacing="5"> <StackPanel VerticalAlignment="Center" Margin="5"> <StackPanel Orientation="Horizontal" IsVisible="{Binding $parent[Border].((device:DeviceInfoControlViewModel)DataContext)?.HasModelInfo}" Spacing="2"> <TextBlock Text="{Binding DeviceViewModel.Device.Specs?.Model}" /> <TextBlock Text="{Binding DeviceViewModel.Device.Specs?.Version}" FontSize="12" Foreground="{DynamicResource TextControlForegroundDisabled}" /> </StackPanel> <TextBlock Foreground="{DynamicResource TextControlForegroundDisabled}" FontSize="12" Text="{Binding DeviceViewModel.Device.Identifier}" /> </StackPanel> </Grid> </Grid> </Border></UserControl>