feat: add compile binding.
This commit is contained in:
@@ -12,7 +12,6 @@
|
||||
|
||||
<ItemGroup>
|
||||
<TrimmerRootDescriptor Include="Roots.xml" />
|
||||
<TrimmerRootAssembly Include="Ursa.Thems.Semi" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
||||
@@ -2,7 +2,8 @@
|
||||
xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:contracts="https://irihi.tech/shared"
|
||||
xmlns:u="https://irihi.tech/ursa">
|
||||
xmlns:u="https://irihi.tech/ursa"
|
||||
x:CompileBindings="True">
|
||||
<!-- Add Resources Here -->
|
||||
<ControlTheme x:Key="{x:Type u:DateRangePicker}" TargetType="u:DateRangePicker">
|
||||
<Setter Property="Background" Value="{DynamicResource TextBoxDefaultBackground}" />
|
||||
@@ -68,9 +69,9 @@
|
||||
Name="{x:Static u:DateRangePicker.PART_Button}"
|
||||
Grid.Column="3"
|
||||
Padding="8,0"
|
||||
IsVisible="{Binding !#ClearButton.IsVisible}"
|
||||
Content="{DynamicResource CalendarDatePickerIconGlyph}"
|
||||
Focusable="False"
|
||||
IsVisible="{Binding !#ClearButton.IsVisible}"
|
||||
Theme="{DynamicResource InnerIconButton}" />
|
||||
</Grid>
|
||||
<Popup
|
||||
@@ -120,18 +121,18 @@
|
||||
Grid.Column="0"
|
||||
Margin="8"
|
||||
BorderThickness="0"
|
||||
FontSize="{DynamicResource DefaultFontSize}"
|
||||
CornerRadius="{Binding $parent[Border].CornerRadius}"
|
||||
FirstDayOfWeek="{TemplateBinding FirstDayOfWeek}"
|
||||
FontSize="{DynamicResource DefaultFontSize}"
|
||||
IsTodayHighlighted="{TemplateBinding IsTodayHighlighted}" />
|
||||
<u:CalendarView
|
||||
Name="{x:Static u:DateRangePicker.PART_EndCalendar}"
|
||||
Grid.Column="1"
|
||||
Margin="8"
|
||||
BorderThickness="0"
|
||||
FontSize="{DynamicResource DefaultFontSize}"
|
||||
CornerRadius="{Binding $parent[Border].CornerRadius}"
|
||||
FirstDayOfWeek="{TemplateBinding FirstDayOfWeek}"
|
||||
FontSize="{DynamicResource DefaultFontSize}"
|
||||
IsTodayHighlighted="{TemplateBinding IsTodayHighlighted}" />
|
||||
</Grid>
|
||||
</DockPanel>
|
||||
@@ -144,7 +145,7 @@
|
||||
|
||||
<Style Selector="^.clearButton, ^.ClearButton">
|
||||
<Style Selector="^:not(:empty):pointerover /template/ Button#ClearButton">
|
||||
<Setter Property="IsVisible" Value="{Binding $parent[u:DatePicker].start, Converter={x:Static ObjectConverters.IsNotNull}}" />
|
||||
<Setter Property="IsVisible" Value="True" />
|
||||
</Style>
|
||||
</Style>
|
||||
|
||||
|
||||
@@ -30,7 +30,6 @@
|
||||
<Setter Property="TextElement.FontFamily" Value="{TemplateBinding FontFamily}" />
|
||||
<Setter Property="TextElement.FontWeight" Value="{TemplateBinding FontWeight}" />
|
||||
<Setter Property="TextElement.FontSize" Value="{TemplateBinding FontSize}" />
|
||||
<Setter Property="ContentPresenter.IsVisible" Value="{Binding Content, RelativeSource={RelativeSource TemplatedParent}, Converter={x:Static ObjectConverters.IsNotNull}}" />
|
||||
<Setter Property="ContentPresenter.Margin" Value="{DynamicResource ThicknessDividerTextMargin}" />
|
||||
<Setter Property="VerticalAlignment" Value="Center" />
|
||||
</ControlTheme>
|
||||
@@ -48,7 +47,10 @@
|
||||
Height="{TemplateBinding Height}"
|
||||
ColumnDefinitions="Auto,Auto,*">
|
||||
<Rectangle Theme="{StaticResource DividerLeftLine}" />
|
||||
<ContentPresenter Grid.Column="1" Theme="{StaticResource DividerContentPresenter}" />
|
||||
<ContentPresenter
|
||||
Grid.Column="1"
|
||||
IsVisible="{Binding Content, RelativeSource={RelativeSource TemplatedParent}, Converter={x:Static ObjectConverters.IsNotNull}}"
|
||||
Theme="{StaticResource DividerContentPresenter}" />
|
||||
<Rectangle Grid.Column="2" Theme="{StaticResource DividerRightLine}" />
|
||||
</Grid>
|
||||
</ControlTemplate>
|
||||
@@ -62,7 +64,10 @@
|
||||
Height="{TemplateBinding Height}"
|
||||
ColumnDefinitions="*,Auto,Auto">
|
||||
<Rectangle Theme="{StaticResource DividerLeftLine}" />
|
||||
<ContentPresenter Grid.Column="1" Theme="{StaticResource DividerContentPresenter}" />
|
||||
<ContentPresenter
|
||||
Grid.Column="1"
|
||||
IsVisible="{Binding Content, RelativeSource={RelativeSource TemplatedParent}, Converter={x:Static ObjectConverters.IsNotNull}}"
|
||||
Theme="{StaticResource DividerContentPresenter}" />
|
||||
<Rectangle Grid.Column="2" Theme="{StaticResource DividerRightLine}" />
|
||||
</Grid>
|
||||
</ControlTemplate>
|
||||
@@ -76,7 +81,10 @@
|
||||
Height="{TemplateBinding Height}"
|
||||
ColumnDefinitions="*,Auto,*">
|
||||
<Rectangle Theme="{StaticResource DividerLeftLine}" />
|
||||
<ContentPresenter Grid.Column="1" Theme="{StaticResource DividerContentPresenter}" />
|
||||
<ContentPresenter
|
||||
Grid.Column="1"
|
||||
IsVisible="{Binding Content, RelativeSource={RelativeSource TemplatedParent}, Converter={x:Static ObjectConverters.IsNotNull}}"
|
||||
Theme="{StaticResource DividerContentPresenter}" />
|
||||
<Rectangle Grid.Column="2" Theme="{StaticResource DividerRightLine}" />
|
||||
</Grid>
|
||||
</ControlTemplate>
|
||||
@@ -90,7 +98,10 @@
|
||||
Height="{TemplateBinding Height}"
|
||||
ColumnDefinitions="*,Auto,*">
|
||||
<Rectangle Theme="{StaticResource DividerLeftLine}" />
|
||||
<ContentPresenter Grid.Column="1" Theme="{StaticResource DividerContentPresenter}" />
|
||||
<ContentPresenter
|
||||
Grid.Column="1"
|
||||
IsVisible="{Binding Content, RelativeSource={RelativeSource TemplatedParent}, Converter={x:Static ObjectConverters.IsNotNull}}"
|
||||
Theme="{StaticResource DividerContentPresenter}" />
|
||||
<Rectangle Grid.Column="2" Theme="{StaticResource DividerRightLine}" />
|
||||
</Grid>
|
||||
</ControlTemplate>
|
||||
|
||||
@@ -248,7 +248,7 @@
|
||||
<Style Selector="^ /template/ Panel#PART_TitleArea">
|
||||
<Setter Property="ContextFlyout">
|
||||
<MenuFlyout>
|
||||
<MenuItem Command="{Binding $parent[u:CustomDialogControl].CloseDialog}" Header="{DynamicResource STRING_MENU_DIALOG_CLOSE}">
|
||||
<MenuItem Command="{Binding $parent[u:CustomDialogControl].Close}" Header="{DynamicResource STRING_MENU_DIALOG_CLOSE}">
|
||||
<MenuItem.Icon>
|
||||
<PathIcon
|
||||
Width="12"
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
RowDefinitions="Auto,Auto,Auto">
|
||||
<Grid.Styles>
|
||||
<Style Selector="TickBar">
|
||||
<Setter Property="ReservedSpace" Value="{Binding #PART_Track.LowerThumb.Bounds}" />
|
||||
<Setter Property="ReservedSpace" Value="{ReflectionBinding #PART_Track.LowerThumb.Bounds}" />
|
||||
</Style>
|
||||
</Grid.Styles>
|
||||
<TickBar
|
||||
@@ -50,7 +50,7 @@
|
||||
TickFrequency="{TemplateBinding u:RangeSlider.TickFrequency}"
|
||||
Ticks="{TemplateBinding Ticks}" />
|
||||
<u:RangeTrack
|
||||
Name="{x:Static u:RangeSlider.PART_Track}"
|
||||
Name="PART_Track"
|
||||
Grid.Row="1"
|
||||
Cursor="Hand"
|
||||
HorizontalAlignment="Stretch"
|
||||
@@ -110,7 +110,7 @@
|
||||
ColumnDefinitions="Auto,Auto,Auto">
|
||||
<Grid.Styles>
|
||||
<Style Selector="TickBar">
|
||||
<Setter Property="ReservedSpace" Value="{Binding #PART_Track.LowerThumb.Bounds}" />
|
||||
<Setter Property="ReservedSpace" Value="{ReflectionBinding #PART_Track.LowerThumb.Bounds}" />
|
||||
</Style>
|
||||
</Grid.Styles>
|
||||
<TickBar
|
||||
@@ -142,7 +142,7 @@
|
||||
TickFrequency="{TemplateBinding u:RangeSlider.TickFrequency}"
|
||||
Ticks="{TemplateBinding Ticks}" />
|
||||
<u:RangeTrack
|
||||
Name="{x:Static u:RangeSlider.PART_Track}"
|
||||
Name="PART_Track"
|
||||
Cursor="Hand"
|
||||
Grid.Column="1"
|
||||
HorizontalAlignment="Stretch"
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
<Setter Property="VerticalAlignment" Value="Top" />
|
||||
<Setter Property="ItemTemplate">
|
||||
<DataTemplate>
|
||||
<u:ClosableTag Command="{Binding $parent[u:TagInput].Close}" Content="{Binding}" />
|
||||
<u:ClosableTag Command="{Binding $parent[u:TagInput].Close}" Content="{ReflectionBinding}" />
|
||||
</DataTemplate>
|
||||
</Setter>
|
||||
<Setter Property="Template">
|
||||
|
||||
@@ -39,7 +39,7 @@ public class ControlClassesInput: TemplatedControl
|
||||
internal static readonly DirectProperty<ControlClassesInput, ObservableCollection<string>> TargetClassesProperty = AvaloniaProperty.RegisterDirect<ControlClassesInput, ObservableCollection<string>>(
|
||||
nameof(TargetClasses), o => o.TargetClasses, (o, v) => o.TargetClasses = v);
|
||||
|
||||
internal ObservableCollection<string> TargetClasses
|
||||
public ObservableCollection<string> TargetClasses
|
||||
{
|
||||
get => _targetClasses;
|
||||
set => SetAndRaise(TargetClassesProperty, ref _targetClasses, value);
|
||||
|
||||
@@ -124,7 +124,7 @@ public class NavMenuItem: HeaderedItemsControl
|
||||
internal static readonly DirectProperty<NavMenuItem, int> LevelProperty = AvaloniaProperty.RegisterDirect<NavMenuItem, int>(
|
||||
nameof(Level), o => o.Level, (o, v) => o.Level = v);
|
||||
private int _level;
|
||||
internal int Level
|
||||
public int Level
|
||||
{
|
||||
get => _level;
|
||||
set => SetAndRaise(LevelProperty, ref _level, value);
|
||||
|
||||
Reference in New Issue
Block a user