mirror of
https://github.com/babalae/better-genshin-impact.git
synced 2026-04-21 21:50:12 +08:00
move namespace
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
using ICSharpCode.AvalonEdit;
|
||||
using System.Windows;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Media;
|
||||
using ICSharpCode.AvalonEdit;
|
||||
|
||||
namespace BetterGenshinImpact.View.Controls;
|
||||
namespace BetterGenshinImpact.View.Controls.CodeEditor;
|
||||
|
||||
public class CodeBox : TextEditor
|
||||
{
|
||||
@@ -1,7 +1,8 @@
|
||||
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:ava="clr-namespace:ICSharpCode.AvalonEdit;assembly=ICSharpCode.AvalonEdit"
|
||||
xmlns:local="clr-namespace:BetterGenshinImpact.View.Controls">
|
||||
xmlns:local="clr-namespace:BetterGenshinImpact.View.Controls"
|
||||
xmlns:codeEditor="clr-namespace:BetterGenshinImpact.View.Controls.CodeEditor">
|
||||
|
||||
<Style x:Key="DefaultTextEditorStyle" TargetType="{x:Type ava:TextEditor}">
|
||||
<Setter Property="FontFamily" Value="{DynamicResource TextThemeFontFamily}" />
|
||||
@@ -10,7 +11,7 @@
|
||||
</Style>
|
||||
|
||||
<Style BasedOn="{StaticResource DefaultTextEditorStyle}" TargetType="{x:Type ava:TextEditor}" />
|
||||
<Style BasedOn="{StaticResource DefaultTextEditorStyle}" TargetType="{x:Type local:CodeBox}" />
|
||||
<Style BasedOn="{StaticResource DefaultTextEditorStyle}" TargetType="{x:Type local:JsonCodeBox}" />
|
||||
<Style BasedOn="{StaticResource DefaultTextEditorStyle}" TargetType="{x:Type codeEditor:CodeBox}" />
|
||||
<Style BasedOn="{StaticResource DefaultTextEditorStyle}" TargetType="{x:Type codeEditor:JsonCodeBox}" />
|
||||
|
||||
</ResourceDictionary>
|
||||
@@ -1,10 +1,10 @@
|
||||
using BetterGenshinImpact.Helpers;
|
||||
using System.IO;
|
||||
using System.Xml;
|
||||
using BetterGenshinImpact.Helpers;
|
||||
using ICSharpCode.AvalonEdit.Highlighting;
|
||||
using ICSharpCode.AvalonEdit.Highlighting.Xshd;
|
||||
using System.IO;
|
||||
using System.Xml;
|
||||
|
||||
namespace BetterGenshinImpact.View.Controls;
|
||||
namespace BetterGenshinImpact.View.Controls.CodeEditor;
|
||||
|
||||
public class JsonCodeBox : CodeBox
|
||||
{
|
||||
@@ -1,10 +1,10 @@
|
||||
using BetterGenshinImpact.Model;
|
||||
using System.Windows;
|
||||
using System.Windows;
|
||||
using System.Windows.Input;
|
||||
using BetterGenshinImpact.Model;
|
||||
using KeyEventArgs = System.Windows.Input.KeyEventArgs;
|
||||
using TextBox = Wpf.Ui.Controls.TextBox;
|
||||
|
||||
namespace BetterGenshinImpact.View.Controls;
|
||||
namespace BetterGenshinImpact.View.Controls.HotKey;
|
||||
|
||||
public class HotKeyTextBox : TextBox
|
||||
{
|
||||
@@ -29,10 +29,10 @@ public class HotKeyTextBox : TextBox
|
||||
|
||||
public static readonly DependencyProperty HotkeyProperty = DependencyProperty.Register(
|
||||
nameof(Hotkey),
|
||||
typeof(HotKey),
|
||||
typeof(Model.HotKey),
|
||||
typeof(HotKeyTextBox),
|
||||
new FrameworkPropertyMetadata(
|
||||
default(HotKey),
|
||||
default(Model.HotKey),
|
||||
FrameworkPropertyMetadataOptions.BindsTwoWayByDefault,
|
||||
(sender, _) =>
|
||||
{
|
||||
@@ -42,9 +42,9 @@ public class HotKeyTextBox : TextBox
|
||||
)
|
||||
);
|
||||
|
||||
public HotKey Hotkey
|
||||
public Model.HotKey Hotkey
|
||||
{
|
||||
get => (HotKey)GetValue(HotkeyProperty);
|
||||
get => (Model.HotKey)GetValue(HotkeyProperty);
|
||||
set => SetValue(HotkeyProperty, value);
|
||||
}
|
||||
|
||||
@@ -114,7 +114,7 @@ public class HotKeyTextBox : TextBox
|
||||
// If Delete/Backspace/Escape is pressed without modifiers - clear current value and return
|
||||
if (key is Key.Delete or Key.Back or Key.Escape && modifiers == ModifierKeys.None)
|
||||
{
|
||||
Hotkey = HotKey.None;
|
||||
Hotkey = Model.HotKey.None;
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -144,7 +144,7 @@ public class HotKeyTextBox : TextBox
|
||||
return;
|
||||
|
||||
// Set value
|
||||
Hotkey = new HotKey(key, modifiers);
|
||||
Hotkey = new Model.HotKey(key, modifiers);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -157,11 +157,11 @@ public class HotKeyTextBox : TextBox
|
||||
{
|
||||
if (HotKeyTypeName == HotKeyTypeEnum.GlobalRegister.ToChineseName())
|
||||
{
|
||||
Hotkey = new HotKey(Key.None);
|
||||
Hotkey = new Model.HotKey(Key.None);
|
||||
}
|
||||
else
|
||||
{
|
||||
Hotkey = new HotKey(Key.None, ModifierKeys.None, args.ChangedButton);
|
||||
Hotkey = new Model.HotKey(Key.None, ModifierKeys.None, args.ChangedButton);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
xmlns:model="clr-namespace:BetterGenshinImpact.Model"
|
||||
xmlns:pages="clr-namespace:BetterGenshinImpact.ViewModel.Pages"
|
||||
xmlns:ui="http://schemas.lepo.co/wpfui/2022/xaml"
|
||||
xmlns:hotKey="clr-namespace:BetterGenshinImpact.View.Controls.HotKey"
|
||||
Title="HotkeyPage"
|
||||
d:DataContext="{d:DesignInstance Type=pages:HotKeyPageViewModel}"
|
||||
d:DesignHeight="850"
|
||||
@@ -50,7 +51,7 @@
|
||||
Command="{Binding SwitchHotKeyTypeCommand}"
|
||||
IsEnabled="{Binding SwitchHotkeyTypeEnabled, Mode=OneWay}"
|
||||
/>
|
||||
<controls:HotKeyTextBox Grid.Column="2"
|
||||
<hotKey:HotKeyTextBox Grid.Column="2"
|
||||
HotKeyTypeName="{Binding HotKeyTypeName, Mode=OneWay}"
|
||||
Hotkey="{Binding HotKey}"
|
||||
Style="{StaticResource DefaultTextBoxStyle}"
|
||||
|
||||
@@ -1,12 +1,10 @@
|
||||
<ui:FluentWindow x:Class="BetterGenshinImpact.View.Windows.AutoPickMonoDialog"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:control="clr-namespace:BetterGenshinImpact.View.Controls"
|
||||
xmlns:codeEditor="clr-namespace:BetterGenshinImpact.View.Controls.CodeEditor"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:local="clr-namespace:BetterGenshinImpact.View.Windows"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:ui="http://schemas.lepo.co/wpfui/2022/xaml"
|
||||
xmlns:viewModel="clr-namespace:BetterGenshinImpact.View.Windows"
|
||||
Title="自动拾取 - 黑白名单设置"
|
||||
Width="600"
|
||||
Height="600"
|
||||
@@ -20,7 +18,7 @@
|
||||
<Window.Resources>
|
||||
<ResourceDictionary>
|
||||
<ResourceDictionary.MergedDictionaries>
|
||||
<ResourceDictionary Source="/View/Controls/CodeBox/CodeBox.xaml" />
|
||||
<ResourceDictionary Source="/View/Controls/CodeEditor/CodeBox.xaml" />
|
||||
</ResourceDictionary.MergedDictionaries>
|
||||
</ResourceDictionary>
|
||||
</Window.Resources>
|
||||
@@ -50,10 +48,10 @@
|
||||
Foreground="{DynamicResource TextFillColorPrimaryBrush}"
|
||||
Text="白名单" />
|
||||
</StackPanel>
|
||||
<control:JsonCodeBox x:Name="WhiteJsonCodeBox"
|
||||
Grid.Row="1"
|
||||
Margin="0,8,0,0"
|
||||
Code="{Binding WhiteJson, Mode=OneTime}" />
|
||||
<codeEditor:JsonCodeBox x:Name="WhiteJsonCodeBox"
|
||||
Grid.Row="1"
|
||||
Margin="0,8,0,0"
|
||||
Code="{Binding WhiteJson, Mode=OneTime}" />
|
||||
</Grid>
|
||||
<Grid Grid.Row="1" Margin="0,16,0,0">
|
||||
<Grid.RowDefinitions>
|
||||
@@ -74,10 +72,10 @@
|
||||
Foreground="{DynamicResource TextFillColorPrimaryBrush}"
|
||||
Text="黑名单" />
|
||||
</StackPanel>
|
||||
<control:JsonCodeBox x:Name="BlackJsonCodeBox"
|
||||
Grid.Row="1"
|
||||
Margin="0,8,0,0"
|
||||
Code="{Binding BlackJson, Mode=OneTime}" />
|
||||
<codeEditor:JsonCodeBox x:Name="BlackJsonCodeBox"
|
||||
Grid.Row="1"
|
||||
Margin="0,8,0,0"
|
||||
Code="{Binding BlackJson, Mode=OneTime}" />
|
||||
</Grid>
|
||||
<Grid Grid.Row="2" Margin="0,8,0,8">
|
||||
<StackPanel HorizontalAlignment="Right" Orientation="Horizontal">
|
||||
@@ -97,4 +95,4 @@
|
||||
</ui:TitleBar.Icon>
|
||||
</ui:TitleBar>
|
||||
</Grid>
|
||||
</ui:FluentWindow>
|
||||
</ui:FluentWindow>
|
||||
Reference in New Issue
Block a user