mirror of
				https://github.com/bolucat/Archive.git
				synced 2025-11-01 04:13:16 +08:00 
			
		
		
		
	Update On Tue Dec 31 19:31:58 CET 2024
This commit is contained in:
		| @@ -0,0 +1,48 @@ | ||||
| using ReactiveUI; | ||||
| using Shadowsocks.ViewModels; | ||||
| using System.Reactive.Disposables; | ||||
| using System.Windows.Input; | ||||
|  | ||||
| namespace Shadowsocks.Views | ||||
| { | ||||
|     /// <summary> | ||||
|     /// Interaction logic for ServerSharingView.xaml | ||||
|     /// </summary> | ||||
|     public partial class ServerSharingView : ReactiveUserControl<ServerSharingViewModel> | ||||
|     { | ||||
|         public ServerSharingView() | ||||
|         { | ||||
|             InitializeComponent(); | ||||
|             ViewModel = new ServerSharingViewModel(); | ||||
|             this.WhenActivated(disposables => | ||||
|             { | ||||
|                 this.OneWayBind(ViewModel, | ||||
|                     viewModel => viewModel.SelectedServerUrlImage, | ||||
|                     view => view.qrCodeImage.Source) | ||||
|                     .DisposeWith(disposables); | ||||
|                 this.OneWayBind(ViewModel, | ||||
|                     viewModel => viewModel.Servers, | ||||
|                     view => view.serversListBox.ItemsSource) | ||||
|                     .DisposeWith(disposables); | ||||
|                 this.Bind(ViewModel, | ||||
|                     viewModel => viewModel.SelectedServer, | ||||
|                     view => view.serversListBox.SelectedItem) | ||||
|                     .DisposeWith(disposables); | ||||
|                 this.OneWayBind(ViewModel, | ||||
|                     viewModel => viewModel.SelectedServerUrl, | ||||
|                     view => view.urlTextBox.Text) | ||||
|                     .DisposeWith(disposables); | ||||
|  | ||||
|                 this.BindCommand(ViewModel, | ||||
|                     viewModel => viewModel.CopyLink, | ||||
|                     view => view.copyLinkButton) | ||||
|                     .DisposeWith(disposables); | ||||
|             }); | ||||
|         } | ||||
|  | ||||
|         private void urlTextBox_PreviewMouseDoubleClick(object sender, MouseButtonEventArgs e) | ||||
|         { | ||||
|             urlTextBox.SelectAll(); | ||||
|         } | ||||
|     } | ||||
| } | ||||
		Reference in New Issue
	
	Block a user
	 github-action[bot]
					github-action[bot]