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
| using Mediator; | |
| namespace $NAMESPACE$; | |
| public class $CLASS$ : ICommandHandler<$COMMAND$> | |
| { | |
| private readonly IUnitOfWorkFactory _unitOfWorkFactory; | |
| public $CLASS$(IUnitOfWorkFactory unitOfWorkFactory) | |
| { |
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
| using Mediator; | |
| namespace $NAMESPACE$; | |
| public class $CLASS$ : ICommand | |
| { | |
| public $CLASS$($END$){} | |
| } |
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 class RelayCommand : ICommand | |
| { | |
| private Action<object> _execute; | |
| private Func<object, bool> _canExecute; | |
| public RelayCommand(Action<object> execute) | |
| { | |
| _execute = execute; | |
| _canExecute = null; |
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 class PrimeViewModel : INotifyPropertyChanged | |
| { | |
| protected bool SetProperty<T>(ref T backingStore, T value, | |
| [CallerMemberName] string propertyName = "", | |
| Action onChanged = null) | |
| { | |
| if (EqualityComparer<T>.Default.Equals(backingStore, value)) | |
| return false; | |
| backingStore = value; |
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
| MyWpfProject.MainWindow mw = new MyWpfProject.MainWindow(); | |
| ElementHost.EnableModelessKeyboardInterop(mw); | |
| mw.Show(); |
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
| <?xml version="1.0" encoding="utf-8"?> | |
| <CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet"> | |
| <CodeSnippet Format="1.0.0"> | |
| <Header> | |
| <Title>Query with handler</Title> | |
| <Author>Patrik Šoma</Author> | |
| <Description>SLM only!</Description> | |
| <Shortcut>qryhnd</Shortcut> | |
| </Header> | |
| <Snippet> |
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
| <?xml version="1.0" encoding="utf-8"?> | |
| <CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet"> | |
| <CodeSnippet Format="1.0.0"> | |
| <Header> | |
| <Title>Command with handler</Title> | |
| <Author>Patrik Šoma</Author> | |
| <Description>SLM Only!</Description> | |
| <Shortcut>cmdhnd</Shortcut> | |
| </Header> | |
| <Snippet> |
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
| <Color x:Key="Primary">#0b5ed7</Color> | |
| <Color x:Key="GridBackground">#4F000000</Color> | |
| <Color x:Key="NexenColor">#9d1c9d</Color> | |
| <Color x:Key="SomaDarkDark">#22272e</Color> | |
| <Color x:Key="SomaDarkLight">#434c57</Color> | |
| <Color x:Key="GithubDark">#24292f</Color> | |
| <Color x:Key="GithubLight">#f6f8fa</Color> | |
| <Color x:Key="GithubRed">#cf222e</Color> | |
| <Color x:Key="GithubGreen">#2da44e</Color> |
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
| <!-- Example of conditional styling --> | |
| <Label Grid.Row="2" Grid.Column="1" Text="{Binding Material.ITEM_STATE_FORMAT}" HorizontalOptions="Center" Style="{StaticResource detailText}"> | |
| <Label.Triggers> | |
| <DataTrigger Binding="{Binding Material.State}" TargetType="Label" Value="B"> | |
| <Setter Property="Style" Value="{StaticResource detailText}" /> | |
| </DataTrigger> | |
| <DataTrigger Binding="{Binding Material.State}" TargetType="Label" Value="N"> | |
| <Setter Property="Style" Value="{StaticResource detailTextError}" /> | |
| </DataTrigger> | |
| </Label.Triggers> |
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
| // Create tasks, must use Task.Run() not new Task() | |
| Task expireTask = Task.Run(()=> { ExpireCheck(); }); | |
| Task agingTask = Task.Run(() => { AgingCheck(); }); | |
| Task fifoTask = Task.Run(() => { FIFOCheck(); }); | |
| Task novalidTask = Task.Run(() => { NoValidCheck(); }); | |
| Task nolifeTask = Task.Run(() => { NoLifeCheck(); }); | |
| // Add them to list | |
| List<Task> tasks = new List<Task>(); | |
| tasks.Add(expireTask); |
NewerOlder