-
Notifications
You must be signed in to change notification settings - Fork 74
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
177 additions
and
60 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
69 changes: 69 additions & 0 deletions
69
src/SyncClipboard.Desktop/Views/SyncContentControlPage.axaml
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
<UserControl x:Class="SyncClipboard.Desktop.Views.SyncContentControlPage" | ||
xmlns="https://github.com/avaloniaui" | ||
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:ui="using:FluentAvalonia.UI.Controls" | ||
xmlns:i18n="using:SyncClipboard.Core.I18n" | ||
xmlns:vm="using:SyncClipboard.Core.ViewModels" | ||
xmlns:local="using:SyncClipboard.Desktop.Views" | ||
xmlns:vc="using:SyncClipboard.Desktop.ValueConverters" | ||
x:DataType="vm:SyncSettingViewModel" | ||
d:DesignWidth="800" | ||
d:DesignHeight="450" | ||
mc:Ignorable="d"> | ||
<Design.DataContext> | ||
<vm:SyncSettingViewModel /> | ||
</Design.DataContext> | ||
<UserControl.Resources> | ||
<ui:SymbolIconSource x:Key="GoIcon" Symbol="ChevronRight" /> | ||
</UserControl.Resources> | ||
<StackPanel Spacing="10"> | ||
<ui:SettingsExpander Header="{x:Static i18n:Strings.SyncContentControl}" IsExpanded="True"> | ||
<ui:SettingsExpander.IconSource> | ||
<ui:FontIconSource Glyph="" FontFamily="{StaticResource SymbolThemeFontFamily}" /> | ||
</ui:SettingsExpander.IconSource> | ||
<ui:SettingsExpander.Items> | ||
<ui:SettingsExpanderItem Content="{x:Static i18n:Strings.EnableDownload}" IsVisible="{Binding IsNormalClientEnable}"> | ||
<ui:SettingsExpanderItem.Footer> | ||
<ToggleSwitch OnContent="{x:Static i18n:Strings.On}" OffContent="{x:Static i18n:Strings.Off}" IsChecked="{Binding DownloadEnable, Mode=TwoWay}" /> | ||
</ui:SettingsExpanderItem.Footer> | ||
</ui:SettingsExpanderItem> | ||
<ui:SettingsExpanderItem Content="{x:Static i18n:Strings.EnableUpload}" IsVisible="{Binding IsNormalClientEnable}"> | ||
<ui:SettingsExpanderItem.Footer> | ||
<ToggleSwitch OnContent="{x:Static i18n:Strings.On}" OffContent="{x:Static i18n:Strings.Off}" IsChecked="{Binding UploadEnable, Mode=TwoWay}" /> | ||
</ui:SettingsExpanderItem.Footer> | ||
</ui:SettingsExpanderItem> | ||
<ui:SettingsExpanderItem Content="{x:Static i18n:Strings.EnableUploadText}"> | ||
<ui:SettingsExpanderItem.Footer> | ||
<ToggleSwitch OnContent="{x:Static i18n:Strings.On}" OffContent="{x:Static i18n:Strings.Off}" IsChecked="{Binding TextEnable, Mode=TwoWay}" /> | ||
</ui:SettingsExpanderItem.Footer> | ||
</ui:SettingsExpanderItem> | ||
<ui:SettingsExpanderItem Content="{x:Static i18n:Strings.EnableUploadFile}"> | ||
<ui:SettingsExpanderItem.Footer> | ||
<ToggleSwitch OnContent="{x:Static i18n:Strings.On}" OffContent="{x:Static i18n:Strings.Off}" IsChecked="{Binding SingleFileEnable, Mode=TwoWay}" /> | ||
</ui:SettingsExpanderItem.Footer> | ||
</ui:SettingsExpanderItem> | ||
<ui:SettingsExpanderItem Content="{x:Static i18n:Strings.EnableUploadMultiFile}"> | ||
<ui:SettingsExpanderItem.Footer> | ||
<ToggleSwitch OnContent="{x:Static i18n:Strings.On}" OffContent="{x:Static i18n:Strings.Off}" IsChecked="{Binding MultiFileEnable, Mode=TwoWay}" /> | ||
</ui:SettingsExpanderItem.Footer> | ||
</ui:SettingsExpanderItem> | ||
<ui:SettingsExpanderItem IsVisible="{OnPlatform Default=True, macOS=False}" Content="{x:Static i18n:Strings.DoNotUploadWhenCut}"> | ||
<ui:SettingsExpanderItem.Footer> | ||
<ToggleSwitch OnContent="{x:Static i18n:Strings.On}" OffContent="{x:Static i18n:Strings.Off}" IsChecked="{Binding DoNotUploadWhenCut, Mode=TwoWay}" /> | ||
</ui:SettingsExpanderItem.Footer> | ||
</ui:SettingsExpanderItem> | ||
<ui:SettingsExpanderItem Content="{x:Static i18n:Strings.MaxFileSizeToUpload}"> | ||
<ui:SettingsExpanderItem.Footer> | ||
<ui:NumberBox Minimum="0" Maximum="100000" Value="{Binding MaxFileSize, Mode=TwoWay}" /> | ||
</ui:SettingsExpanderItem.Footer> | ||
</ui:SettingsExpanderItem> | ||
<ui:SettingsExpanderItem ActionIconSource="{StaticResource GoIcon}" | ||
IsClickEnabled="True" | ||
Command="{Binding SetFileSyncFilterCommand}" | ||
Content="{x:Static i18n:Strings.FileSyncFilter}" /> | ||
</ui:SettingsExpander.Items> | ||
</ui:SettingsExpander> | ||
</StackPanel> | ||
</UserControl> |
17 changes: 17 additions & 0 deletions
17
src/SyncClipboard.Desktop/Views/SyncContentControlPage.axaml.cs
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
using Avalonia.Controls; | ||
using Microsoft.Extensions.DependencyInjection; | ||
using SyncClipboard.Core.ViewModels; | ||
|
||
namespace SyncClipboard.Desktop.Views; | ||
|
||
public partial class SyncContentControlPage : UserControl | ||
{ | ||
private readonly SyncSettingViewModel _viewModel; | ||
|
||
public SyncContentControlPage() | ||
{ | ||
this.InitializeComponent(); | ||
_viewModel = App.Current.Services.GetRequiredService<SyncSettingViewModel>(); | ||
this.DataContext = _viewModel; | ||
} | ||
} |
This file contains 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
This file contains 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
45 changes: 45 additions & 0 deletions
45
src/SyncClipboard.WinUI3/Views/SyncContentControlPage.xaml
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
<?xml version="1.0" encoding="utf-8" ?> | ||
<Page x:Class="SyncClipboard.WinUI3.Views.SyncContentControlPage" | ||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
xmlns:local="using:SyncClipboard.WinUI3.Views" | ||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | ||
xmlns:ui="using:CommunityToolkit.WinUI.Controls" | ||
xmlns:i18n="using:SyncClipboard.Core.I18n" | ||
xmlns:vm="using:SyncClipboard.Core.ViewModels" | ||
xmlns:vc="using:SyncClipboard.WinUI3.ValueConverters" | ||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | ||
mc:Ignorable="d"> | ||
|
||
<StackPanel Spacing="10"> | ||
<ui:SettingsExpander Header="{x:Bind i18n:Strings.SyncContentControl}" IsExpanded="True"> | ||
<ui:SettingsExpander.HeaderIcon> | ||
<FontIcon Glyph="" /> | ||
</ui:SettingsExpander.HeaderIcon> | ||
<ui:SettingsExpander.Items> | ||
<ui:SettingsCard Header="{x:Bind i18n:Strings.EnableDownload}" Visibility="{x:Bind vc:ConvertMethod.BoolToVisibility(_viewModel.IsNormalClientEnable), Mode=OneWay}"> | ||
<ToggleSwitch OnContent="{x:Bind i18n:Strings.On}" OffContent="{x:Bind i18n:Strings.Off}" IsOn="{x:Bind _viewModel.DownloadEnable, Mode=TwoWay}" /> | ||
</ui:SettingsCard> | ||
<ui:SettingsCard Header="{x:Bind i18n:Strings.EnableUpload}" Visibility="{x:Bind vc:ConvertMethod.BoolToVisibility(_viewModel.IsNormalClientEnable), Mode=OneWay}"> | ||
<ToggleSwitch OnContent="{x:Bind i18n:Strings.On}" OffContent="{x:Bind i18n:Strings.Off}" IsOn="{x:Bind _viewModel.UploadEnable, Mode=TwoWay}" /> | ||
</ui:SettingsCard> | ||
<ui:SettingsCard Header="{x:Bind i18n:Strings.EnableUploadText}"> | ||
<ToggleSwitch OnContent="{x:Bind i18n:Strings.On}" OffContent="{x:Bind i18n:Strings.Off}" IsOn="{x:Bind _viewModel.TextEnable, Mode=TwoWay}" /> | ||
</ui:SettingsCard> | ||
<ui:SettingsCard Header="{x:Bind i18n:Strings.EnableUploadFile}"> | ||
<ToggleSwitch OnContent="{x:Bind i18n:Strings.On}" OffContent="{x:Bind i18n:Strings.Off}" IsOn="{x:Bind _viewModel.SingleFileEnable, Mode=TwoWay}" /> | ||
</ui:SettingsCard> | ||
<ui:SettingsCard Header="{x:Bind i18n:Strings.EnableUploadMultiFile}"> | ||
<ToggleSwitch OnContent="{x:Bind i18n:Strings.On}" OffContent="{x:Bind i18n:Strings.Off}" IsOn="{x:Bind _viewModel.MultiFileEnable, Mode=TwoWay}" /> | ||
</ui:SettingsCard> | ||
<ui:SettingsCard Header="{x:Bind i18n:Strings.DoNotUploadWhenCut}"> | ||
<ToggleSwitch OnContent="{x:Bind i18n:Strings.On}" OffContent="{x:Bind i18n:Strings.Off}" IsOn="{x:Bind _viewModel.DoNotUploadWhenCut, Mode=TwoWay}" /> | ||
</ui:SettingsCard> | ||
<ui:SettingsCard Header="{x:Bind i18n:Strings.MaxFileSizeToUpload}"> | ||
<NumberBox Minimum="0" Maximum="100000" Value="{x:Bind _viewModel.MaxFileSize, Mode=TwoWay}" /> | ||
</ui:SettingsCard> | ||
<ui:SettingsCard Header="{x:Bind i18n:Strings.FileSyncFilter}" IsClickEnabled="True" Command="{x:Bind _viewModel.SetFileSyncFilterCommand}" /> | ||
</ui:SettingsExpander.Items> | ||
</ui:SettingsExpander> | ||
</StackPanel> | ||
</Page> |
18 changes: 18 additions & 0 deletions
18
src/SyncClipboard.WinUI3/Views/SyncContentControlPage.xaml.cs
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
using Microsoft.Extensions.DependencyInjection; | ||
using Microsoft.UI.Xaml.Controls; | ||
using SyncClipboard.Core.ViewModels; | ||
|
||
namespace SyncClipboard.WinUI3.Views; | ||
|
||
/// <summary> | ||
/// An empty window that can be used on its own or navigated to within a Frame. | ||
/// </summary> | ||
public sealed partial class SyncContentControlPage : Page | ||
{ | ||
private readonly SyncSettingViewModel _viewModel; | ||
public SyncContentControlPage() | ||
{ | ||
this.InitializeComponent(); | ||
_viewModel = App.Current.Services.GetRequiredService<SyncSettingViewModel>(); | ||
} | ||
} |
This file contains 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