feat: init avalonia demo.
This commit is contained in:
1 parent
adb6355884
commit
63bf5c6aa7
95 files changed
+20896
-2634
No files matched your search
File diff suppressed because it is too large.
Load diff
@@ -10,7 +10,9 @@ namespace HandyControlDemo.Tools;
|
||||
|
||||
internal class HighlightingProvider
|
||||
{
|
||||
public static HighlightingProvider Default = new Lazy<HighlightingProvider>(() => new HighlightingProvider()).Value;
|
||||
private static readonly Lazy<HighlightingProvider> DefaultInternal = new(() => new HighlightingProvider());
|
||||
|
||||
public static HighlightingProvider Default => DefaultInternal.Value;
|
||||
|
||||
protected static readonly Lazy<IHighlightingDefinition> DefaultDefinition = new(() => HighlightingManager.Instance.GetDefinition("C#"));
|
||||
|
||||
|
||||
@@ -44,7 +44,7 @@
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<Rectangle Width="16" Height="16" Fill="{Binding ImageBrush}"/>
|
||||
<hc:HighlightTextBlock Margin="6,0,0,0" SourceText="{ex:Lang Key={Binding Name}}" QueriesText="{Binding QueriesText}"/>
|
||||
<Path Visibility="{Binding IsNew,Converter={StaticResource Boolean2VisibilityConverter}}" VerticalAlignment="Center" Data="{StaticResource NewGeometry}" Stretch="Uniform" Margin="10,0,0,0" Width="30" Height="14" Fill="{DynamicResource DangerBrush}"/>
|
||||
<Path Visibility="{Binding IsNew,Converter={StaticResource Boolean2VisibilityConverter}}" VerticalAlignment="Center" Data="{StaticResource NewGeometry}" Stretch="Uniform" Margin="10,0,0,0" Width="30" Height="14" Fill="{DynamicResource AccentBrush}"/>
|
||||
</StackPanel>
|
||||
</DataTemplate>
|
||||
</ListBox.ItemTemplate>
|
||||
|
||||
@@ -8,6 +8,11 @@ namespace HandyControlDemo.ViewModel;
|
||||
|
||||
public class ViewModelLocator
|
||||
{
|
||||
private static readonly Lazy<ViewModelLocator> InstanceInternal = new(() =>
|
||||
Application.Current.TryFindResource("Locator") as ViewModelLocator, isThreadSafe: true);
|
||||
|
||||
public static ViewModelLocator Instance => InstanceInternal.Value;
|
||||
|
||||
public ViewModelLocator()
|
||||
{
|
||||
SimpleIoc.Default.Register<DataService>();
|
||||
@@ -41,9 +46,6 @@ public class ViewModelLocator
|
||||
SimpleIoc.Default.Register<InputElementDemoViewModel>();
|
||||
}
|
||||
|
||||
public static ViewModelLocator Instance = new Lazy<ViewModelLocator>(() =>
|
||||
Application.Current.TryFindResource("Locator") as ViewModelLocator).Value;
|
||||
|
||||
#region Vm
|
||||
|
||||
public MainViewModel Main => SimpleIoc.Default.GetInstance<MainViewModel>();
|
||||
|
||||
@@ -84,8 +84,8 @@
|
||||
<RowDefinition x:Name="RowDefinition0" Height="Auto" />
|
||||
<RowDefinition x:Name="RowDefinition1" Height="*" />
|
||||
</Grid.RowDefinitions>
|
||||
<TabPanel x:Name="headerPanel" Background="Transparent" Grid.Column="0" IsItemsHost="true" Margin="0" Grid.Row="0"/>
|
||||
<Border x:Name="contentPanel" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" BorderThickness="{TemplateBinding BorderThickness}" BorderBrush="{DynamicResource BorderBrush}" Background="{TemplateBinding Background}" Grid.Column="0" Grid.Row="1">
|
||||
<TabPanel x:Name="headerPanel" Background="Transparent" IsItemsHost="true" Margin="0" Grid.Row="0"/>
|
||||
<Border x:Name="contentPanel" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" BorderThickness="{TemplateBinding BorderThickness}" BorderBrush="{DynamicResource BorderBrush}" Background="{TemplateBinding Background}" Grid.Row="1">
|
||||
<ContentPresenter x:Name="PART_SelectedContentHost" ContentSource="SelectedContent" Margin="0" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
|
||||
</Border>
|
||||
</Grid>
|
||||
|
||||
@@ -20,7 +20,9 @@ public class ConfigHelper : INotifyPropertyChanged
|
||||
|
||||
}
|
||||
|
||||
public static ConfigHelper Instance = new Lazy<ConfigHelper>(() => new ConfigHelper()).Value;
|
||||
private static readonly Lazy<ConfigHelper> InstanceInternal = new(() => new ConfigHelper(), isThreadSafe: true);
|
||||
|
||||
public static ConfigHelper Instance => InstanceInternal.Value;
|
||||
|
||||
private XmlLanguage _lang = XmlLanguage.GetLanguage("zh-cn");
|
||||
|
||||
|
||||
Reference in new issue
Block a user