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
| [TestMethod] | |
| [TestCategory("Windows - Bootstrap - ClientConnection")] | |
| public async Task Connected_event_fires_on_connection() | |
| { | |
| // Arrange | |
| int port = 1000; | |
| var result = this.StartServer(port); | |
| var serverInfo = new ServerConnectionInfo { Url = "127.0.0.1", Port = port }; | |
| var userInfo = new UserInformation { Nickname = "Unit", PrimaryNickname = "Unit" }; |
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 async Task<NotificationManager> Connect(ServerConnectionInfo serverInfo, UserInformation userInfo) | |
| { | |
| this.tcpClient = new TcpClient(); | |
| this.ServerInformation = serverInfo; | |
| this.UserInformation = userInfo; | |
| try | |
| { | |
| await this.tcpClient.ConnectAsync(serverInfo.Url, serverInfo.Port); | |
| } |
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 interface ILocalizationService | |
| { | |
| string GetLocalizedMessage(ResourceManager manager, string key); | |
| } | |
| public class LocalizationService : ILocalizationService | |
| { | |
| public string CurrentLocal { get; set; } = string.Empty; | |
| public string GetLocalizedMessage(ResourceManager manager, string key) |
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 void Dispose() | |
| { | |
| this.networkCommunicator.Dispose(); | |
| } |
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 x:Class="WpfApplication1.MainWindow" | |
| xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | |
| 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:local="clr-namespace:WpfApplication1" | |
| mc:Ignorable="d" | |
| Title="MainWindow" Height="350" Width="525"> | |
| <Window.Resources> | |
| <Style x:Key="RootStyle" /> |
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 BaseBindableEntity : BaseEditableEntity | |
| { | |
| private static Dictionary<Type, IEnumerable<PropertyInfo>> bindableProperties = | |
| new Dictionary<Type, IEnumerable<PropertyInfo>>(); | |
| public BaseBindableEntity() | |
| { | |
| Type thisType = this.GetType(); | |
| if (!bindableProperties.ContainsKey(thisType)) | |
| { |
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 x:Class="WpfApplication2.MainWindow" | |
| xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | |
| 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:local="clr-namespace:WpfApplication2" | |
| mc:Ignorable="d" | |
| Title="MainWindow" Height="350" Width="525"> | |
| <Grid> | |
| <ItemsControl ItemsSource="{Binding MyCollection}"> |
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 x:Class="WpfApplication2.MainWindow" | |
| x:Name="mainWindow" | |
| xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | |
| 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:local="clr-namespace:WpfApplication2" | |
| mc:Ignorable="d" | |
| Title="MainWindow" Height="350" Width="525"> | |
| <Grid> |
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
| private async void ShowAlert_Clicked(object sender, RoutedEventArgs e) | |
| { | |
| var alertService = ServiceFactory.CreateService<IAlertService>(); | |
| Debug.WriteLine("Entering Show Alert"); | |
| await alertService.ShowAlertAsync( | |
| "Save Item", | |
| "You have unsaved changes, would you like to save before closing?", | |
| new CallbackDelegate( // Follow-up alert. | |
| "Yes", | |
| async () => |
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
| <controls:MetroWindow x:Class="Pen.Apps.Desktop.Views.AlertDialog" | |
| xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | |
| xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | |
| xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | |
| xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | |
| xmlns:viewModels="clr-namespace:Pen.Apps.Presentation.ViewModels;assembly=Pen.Apps.Presentation" | |
| xmlns:controls="http://metro.mahapps.com/winfx/xaml/controls" | |
| xmlns:converters="clr-namespace:Pen.Apps.Desktop.Converters" | |
| mc:Ignorable="d" | |
| d:DataContext="{d:DesignInstance Type=viewModels:AlertDialogViewModel}" |