File tree Expand file tree Collapse file tree
SnapX.Avalonia/Views/Settings/Views/TextUploaders Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ <UserControl
2+ x : Class =" SnapX.Avalonia.Views.Settings.Views.TextUploaders.HastebinUploaderSettingsView"
3+ x : DataType =" txt:Hastebin"
4+ xmlns =" https://github.com/avaloniaui"
5+ xmlns : controls =" clr-namespace:FluentAvalonia.UI.Controls;assembly=FluentAvalonia"
6+ xmlns : txt =" clr-namespace:SnapX.Core.Upload.Text;assembly=SnapX.Core"
7+ xmlns : x =" http://schemas.microsoft.com/winfx/2006/xaml" >
8+
9+ <StackPanel Spacing =" 4" >
10+ <controls : SettingsExpanderItem Content =" Custom Domain" Description =" Use a different API if you need, otherwise leave default. Hastebin Topal is NOT supported." >
11+ <controls : SettingsExpanderItem .Footer>
12+ <TextBox
13+ Name =" txtCustomURL"
14+ Watermark =" https://pastie.io"
15+ Width =" 200" />
16+ </controls : SettingsExpanderItem .Footer>
17+ </controls : SettingsExpanderItem >
18+
19+ <controls : SettingsExpanderItem Content =" Syntax highlighting" >
20+ <controls : SettingsExpanderItem .Footer>
21+ <TextBox
22+ Name =" txtSyntaxHightlight"
23+ Watermark =" hs"
24+ Width =" 200" />
25+ </controls : SettingsExpanderItem .Footer>
26+ </controls : SettingsExpanderItem >
27+ <controls : SettingsExpanderItem Content =" Paste Options" >
28+ <controls : SettingsExpanderItem .Footer>
29+ <CheckBox Content =" Use file extension for syntax highlighting (except .txt)" Name =" cbUseFileExtension" />
30+ </controls : SettingsExpanderItem .Footer>
31+ </controls : SettingsExpanderItem >
32+ </StackPanel >
33+ </UserControl >
Original file line number Diff line number Diff line change 1+
2+ using Avalonia . Controls ;
3+ using SnapX . Core . Upload . Text ;
4+
5+ namespace SnapX . Avalonia . Views . Settings . Views . TextUploaders ;
6+
7+ public partial class HastebinUploaderSettingsView : UserControl
8+ {
9+ public HastebinUploaderSettingsView ( )
10+ {
11+ InitializeComponent ( ) ;
12+ }
13+
14+ protected override void OnDataContextChanged ( EventArgs e )
15+ {
16+ base . OnDataContextChanged ( e ) ;
17+
18+ if ( DataContext is not Hastebin ) return ;
19+ var config = SnapX . Core . SnapXL . UploadersConfig ;
20+ cbUseFileExtension . IsChecked = config . HastebinUseFileExtension ;
21+ cbUseFileExtension . IsCheckedChanged += ( Sender , Args ) => config . HastebinUseFileExtension = cbUseFileExtension . IsChecked ?? false ;
22+
23+ txtSyntaxHightlight . Text = config . HastebinSyntaxHighlighting ;
24+ txtSyntaxHightlight . TextChanged += ( Sender , Args ) => config . HastebinSyntaxHighlighting = txtSyntaxHightlight . Text ;
25+ txtCustomURL . Text = config . HastebinCustomDomain ;
26+ txtCustomURL . TextChanged += ( Sender , Args ) => config . HastebinCustomDomain = txtCustomURL . Text ;
27+ }
28+ }
You can’t perform that action at this time.
0 commit comments