This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <Style x:Key="MaterialDesignAccentButtonStyle" TargetType="{x:Type Button}"> | |
| <Setter Property="FocusVisualStyle" Value="{x:Null}"/> | |
| <Setter Property="Background" Value="{StaticResource Accent}"/> | |
| <Setter Property="BorderBrush" Value="{StaticResource AccentDark}"/> | |
| <Setter Property="BorderThickness" Value="1"/> | |
| <Setter Property="Foreground" Value="White"/> | |
| <Setter Property="HorizontalContentAlignment" Value="Center"/> | |
| <Setter Property="VerticalContentAlignment" Value="Center"/> | |
| <Setter Property="Padding" Value="16,3,16,3"/> | |
| <Setter Property="FontSize" Value="16"/> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <Window.InputBindings> | |
| <KeyBinding Command="{Binding Command}" Key="F10"></KeyBinding> | |
| </Window.InputBindings> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <Window.Resources> | |
| <Style TargetType="Image"> | |
| <Setter Property="RenderOptions.BitmapScalingMode" Value="HighQuality" /> | |
| </Style> | |
| <Style TargetType="ContentControl"> | |
| <Setter Property="FocusVisualStyle" Value="{x:Null}"/> | |
| </Style> | |
| </Window.Resources> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| MainWindow mainWindowInstance; | |
| public SearchDeviceView(MainWindow mainWindow) | |
| { | |
| InitializeComponent(); | |
| mainWindowInstance = mainWindow; | |
| var viewModel = (Presenter)mainWindow.DataContext; | |
| viewModel.ViewEvent += ViewModel_ViewEvent; | |
| SearchDeviceViewShowing = true; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Application.Current.Dispatcher.Invoke(Application.Current.Shutdown); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| OneCommand = new RelayCommand(o => OneMethod(), o => true); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Application.Current.ShutdownMode = ShutdownMode.OnMainWindowClose; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /// <summary> | |
| /// Interface for commands to use in MVVM Pattern. It implements ICommand interface. | |
| /// </summary> | |
| public class RelayCommand : ICommand | |
| { | |
| readonly Action<object> execute; | |
| readonly Func<object, bool> canExecute; | |
| /// <summary> | |
| /// CanExecuteChanged event handler. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| string name; | |
| public string Name | |
| { | |
| get { return name; } | |
| set | |
| { | |
| name = value; | |
| OnPropertyChanged(nameof(Name)); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public static byte[] StringToByteArray(string hex) | |
| { | |
| return Enumerable.Range(0, hex.Length) | |
| .Where(x => x % 2 == 0) | |
| .Select(x => Convert.ToByte(hex.Substring(x, 2), 16)) | |
| .ToArray(); | |
| } |