-
Notifications
You must be signed in to change notification settings - Fork 76
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
8 changed files
with
113 additions
and
19 deletions.
There are no files selected for viewing
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
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
59 changes: 59 additions & 0 deletions
59
src/SyncClipboard.Desktop/Views/FileSyncFilterSettingPage.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,59 @@ | ||
<UserControl x:Class="SyncClipboard.Desktop.Views.FileSyncFilterSettingPage" | ||
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:m="using:SyncClipboard.Core.Models" | ||
x:DataType="vm:FileSyncFilterSettingViewModel" | ||
d:DesignWidth="800" | ||
d:DesignHeight="450" | ||
mc:Ignorable="d"> | ||
<Design.DataContext> | ||
<vm:FileSyncFilterSettingViewModel /> | ||
</Design.DataContext> | ||
<Grid> | ||
<Grid.RowDefinitions> | ||
<RowDefinition Height="Auto" /> | ||
<RowDefinition Height="*" /> | ||
</Grid.RowDefinitions> | ||
<ui:SettingsExpander Grid.Row="0" Header="{x:Static i18n:Strings.FilterMode}" Description="{x:Static i18n:Strings.FileFilterDescription}"> | ||
<ui:SettingsExpander.IconSource> | ||
<ui:FontIconSource Glyph="" FontFamily="{StaticResource SymbolThemeFontFamily}" /> | ||
</ui:SettingsExpander.IconSource> | ||
<ui:SettingsExpander.Footer> | ||
<ComboBox SelectedItem="{Binding FilterMode, Mode=TwoWay}" ItemsSource="{x:Static vm:FileSyncFilterSettingViewModel.Modes}"> | ||
<ComboBox.ItemTemplate> | ||
<DataTemplate x:DataType="m:LocaleString"> | ||
<TextBlock Text="{Binding ShownString}" /> | ||
</DataTemplate> | ||
</ComboBox.ItemTemplate> | ||
</ComboBox> | ||
</ui:SettingsExpander.Footer> | ||
</ui:SettingsExpander> | ||
<Grid Grid.Row="1" Margin="0,10,0,0" IsVisible="{Binding EnableText, Mode=OneWay}"> | ||
<Grid.ColumnDefinitions> | ||
<ColumnDefinition Width="*" /> | ||
<ColumnDefinition Width="Auto" /> | ||
</Grid.ColumnDefinitions> | ||
<ScrollViewer x:Name="_ScrollViewer" Grid.Column="0" VerticalScrollBarVisibility="Auto"> | ||
<TextBox Grid.Column="0" | ||
Text="{Binding ShownText, Mode=TwoWay}" | ||
TextWrapping="Wrap" | ||
FontSize="16" | ||
AcceptsReturn="True" | ||
VerticalContentAlignment="Top" | ||
CornerRadius="{DynamicResource ControlCornerRadius}" /> | ||
</ScrollViewer> | ||
<StackPanel Grid.Column="1" | ||
MinWidth="80" | ||
Margin="16,0,0,0" | ||
Orientation="Vertical" | ||
Spacing="10"> | ||
<Button HorizontalAlignment="Stretch" Content="{x:Static i18n:Strings.Save}" Command="{Binding ApplyCommand}" /> | ||
</StackPanel> | ||
</Grid> | ||
</Grid> | ||
</UserControl> |
31 changes: 31 additions & 0 deletions
31
src/SyncClipboard.Desktop/Views/FileSyncFilterSettingPage.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,31 @@ | ||
using Avalonia.Controls; | ||
using Avalonia.Interactivity; | ||
using FluentAvalonia.UI.Controls; | ||
using FluentAvalonia.UI.Navigation; | ||
using Microsoft.Extensions.DependencyInjection; | ||
using SyncClipboard.Core.ViewModels; | ||
|
||
namespace SyncClipboard.Desktop.Views; | ||
|
||
public partial class FileSyncFilterSettingPage : UserControl | ||
{ | ||
private readonly FileSyncFilterSettingViewModel _viewModel; | ||
public FileSyncFilterSettingPage() | ||
{ | ||
_viewModel = App.Current.Services.GetRequiredService<FileSyncFilterSettingViewModel>(); | ||
DataContext = _viewModel; | ||
InitializeComponent(); | ||
AddHandler(Frame.NavigatedToEvent, OnNavigatedTo, RoutingStrategies.Direct); | ||
AddHandler(Frame.NavigatedFromEvent, OnNavigatedFrom, RoutingStrategies.Direct); | ||
} | ||
|
||
private void OnNavigatedFrom(object? sender, NavigationEventArgs e) | ||
{ | ||
App.Current.MainWindow.EnableScrollViewer(); | ||
} | ||
|
||
private void OnNavigatedTo(object? sender, NavigationEventArgs e) | ||
{ | ||
App.Current.MainWindow.DispableScrollViewer(); | ||
} | ||
} |
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