diff --git a/ConvertMoels/BoolToVisidilityConvert.cs b/ConvertMoels/BoolToVisidilityConvert.cs new file mode 100644 index 0000000..f3b5ea0 --- /dev/null +++ b/ConvertMoels/BoolToVisidilityConvert.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Globalization; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Data; + +namespace SunlightCentralizedControlManagement_SCCM_.ConvertMoels +{ + internal class BoolToVisidilityConvert : IValueConverter + { + public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) + { + return (value is bool boolvalue && boolvalue) ? + Visibility.Visible: + Visibility.Collapsed; + } + + public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) + { + throw new NotImplementedException(); + } + + } +} diff --git a/SunlightCentralizedControlManagement_SCCM_.csproj b/SunlightCentralizedControlManagement_SCCM_.csproj index 8c761e2..02150fb 100644 --- a/SunlightCentralizedControlManagement_SCCM_.csproj +++ b/SunlightCentralizedControlManagement_SCCM_.csproj @@ -102,6 +102,7 @@ + DispenseState.xaml @@ -140,6 +141,7 @@ + diff --git a/View/MonitorView.xaml b/View/MonitorView.xaml index 7096876..3ade4bd 100644 --- a/View/MonitorView.xaml +++ b/View/MonitorView.xaml @@ -8,12 +8,13 @@ xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes" xmlns:rdp="clr-namespace:VncSharpWpf;assembly=VncSharpWpf" xmlns:viewmodel="clr-namespace:SunlightCentralizedControlManagement_SCCM_.ViewModel" - xmlns:ConvertMoels="clr-namespace:SunlightCentralizedControlManagement_SCCM_.ConvertMoels" - d:DataContext="{d:DesignInstance Type=viewmodel:MainWindowViewModel}" + xmlns:ConvertMoels="clr-namespace:SunlightCentralizedControlManagement_SCCM_.ConvertMoels" + d:DataContext="{d:DesignInstance Type=local:MonitorView}" mc:Ignorable="d" d:DesignHeight="1000" d:DesignWidth="1900"> + @@ -91,7 +92,7 @@ - + @@ -103,9 +104,10 @@ HorizontalGridLinesBrush="#FFC9C9C9" VerticalGridLinesBrush="#FFC9C9C9" Background="White" GridLinesVisibility="All" ColumnHeaderHeight="40" HorizontalContentAlignment="Right" BorderBrush="{x:Null}" CanUserReorderColumns="False" CanUserSortColumns="False" CanUserResizeRows="False" CanUserResizeColumns="False" - CanUserDeleteRows="False" SelectionMode="Single" FontSize="15" Focusable="True" > - + CanUserDeleteRows="False" SelectionMode="Single" FontSize="15" Focusable="True" ContextMenuOpening="Gridstep_ContextMenuOpening"> +