Skip to content

Commit

Permalink
Update to 11.0.0-preview5
Browse files Browse the repository at this point in the history
  • Loading branch information
wieslawsoltes committed Feb 3, 2023
1 parent 0625825 commit 6ac3587
Show file tree
Hide file tree
Showing 18 changed files with 46 additions and 66 deletions.
2 changes: 1 addition & 1 deletion build/Avalonia.Desktop.props
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<PackageReference Include="Avalonia.Desktop" Version="11.0.999-cibuild0028096-beta" />
<PackageReference Include="Avalonia.Desktop" Version="11.0.0-preview5" />
</ItemGroup>
</Project>
2 changes: 1 addition & 1 deletion build/Avalonia.Diagnostics.props
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<PackageReference Include="Avalonia.Diagnostics" Version="11.0.999-cibuild0028096-beta" Condition="'$(Configuration)' == 'Debug'" />
<PackageReference Include="Avalonia.Diagnostics" Version="11.0.0-preview5" Condition="'$(Configuration)' == 'Debug'" />
</ItemGroup>
</Project>
2 changes: 1 addition & 1 deletion build/Avalonia.ReactiveUI.props
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<PackageReference Include="Avalonia.ReactiveUI" Version="11.0.999-cibuild0028096-beta" />
<PackageReference Include="Avalonia.ReactiveUI" Version="11.0.0-preview5" />
</ItemGroup>
</Project>
2 changes: 1 addition & 1 deletion build/Avalonia.Themes.Fluent.props
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<PackageReference Include="Avalonia.Themes.Fluent" Version="11.0.999-cibuild0028096-beta" />
<PackageReference Include="Avalonia.Themes.Fluent" Version="11.0.0-preview5" />
</ItemGroup>
</Project>
2 changes: 1 addition & 1 deletion build/Avalonia.Themes.Simple.props
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<PackageReference Include="Avalonia.Themes.Simple" Version="11.0.999-cibuild0028096-beta" />
<PackageReference Include="Avalonia.Themes.Simple" Version="11.0.0-preview5" />
</ItemGroup>
</Project>
2 changes: 1 addition & 1 deletion build/Avalonia.Web.props
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<PackageReference Include="Avalonia.Browser" Version="11.0.999-cibuild0028096-beta" />
<PackageReference Include="Avalonia.Browser" Version="11.0.0-preview5" />
</ItemGroup>
</Project>
2 changes: 1 addition & 1 deletion build/Avalonia.props
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<PackageReference Include="Avalonia" Version="11.0.999-cibuild0028096-beta" />
<PackageReference Include="Avalonia" Version="11.0.0-preview5" />
</ItemGroup>
</Project>
4 changes: 2 additions & 2 deletions build/Base.props
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<VersionPrefix>11.0.999</VersionPrefix>
<VersionSuffix></VersionSuffix>
<VersionPrefix>11.0.0</VersionPrefix>
<VersionSuffix>preview5</VersionSuffix>
<Authors>Wiesław Šoltés</Authors>
<Company>Wiesław Šoltés</Company>
<Description>A docking layout system.</Description>
Expand Down
11 changes: 2 additions & 9 deletions samples/DockMvvmSample/Themes/FluentThemeManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ public class FluentThemeManager : IThemeManager

private static readonly FluentTheme Fluent = new()
{
Mode = FluentThemeMode.Light
};

private static readonly Styles DockFluent = new()
Expand Down Expand Up @@ -51,10 +50,7 @@ public void Switch(int index)
// Fluent Light
case 0:
{
if (Fluent.Mode != FluentThemeMode.Light)
{
Fluent.Mode = FluentThemeMode.Light;
}
Application.Current.RequestedThemeVariant = ThemeVariant.Light;
Application.Current.Styles[0] = Fluent;
Application.Current.Styles[1] = DockFluent;
Application.Current.Styles[2] = FluentLight;
Expand All @@ -63,10 +59,7 @@ public void Switch(int index)
// Fluent Dark
case 1:
{
if (Fluent.Mode != FluentThemeMode.Dark)
{
Fluent.Mode = FluentThemeMode.Dark;
}
Application.Current.RequestedThemeVariant = ThemeVariant.Dark;
Application.Current.Styles[0] = Fluent;
Application.Current.Styles[1] = DockFluent;
Application.Current.Styles[2] = FluentDark;
Expand Down
11 changes: 2 additions & 9 deletions samples/DockMvvmSample/Themes/SimpleThemeManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ public class SimpleThemeManager : IThemeManager

private static readonly SimpleTheme Simple = new()
{
Mode = SimpleThemeMode.Light
};

private static readonly Styles DockSimple = new()
Expand Down Expand Up @@ -51,10 +50,7 @@ public void Switch(int index)
// Simple Light
case 0:
{
if (Simple.Mode != SimpleThemeMode.Light)
{
Simple.Mode = SimpleThemeMode.Light;
}
Application.Current.RequestedThemeVariant = ThemeVariant.Light;
Application.Current.Styles[0] = Simple;
Application.Current.Styles[1] = DockSimple;
Application.Current.Styles[2] = SimpleLight;
Expand All @@ -63,10 +59,7 @@ public void Switch(int index)
// Simple Dark
case 1:
{
if (Simple.Mode != SimpleThemeMode.Dark)
{
Simple.Mode = SimpleThemeMode.Dark;
}
Application.Current.RequestedThemeVariant = ThemeVariant.Dark;
Application.Current.Styles[0] = Simple;
Application.Current.Styles[1] = DockSimple;
Application.Current.Styles[2] = SimpleDark;
Expand Down
5 changes: 3 additions & 2 deletions samples/DockXamlSample/App.axaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
<Application xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
x:Class="DockXamlSample.App"
Name="Dock Avalonia Demo"
x:Class="DockXamlSample.App">
RequestedThemeVariant="Light">

<Application.Styles>
<FluentTheme Mode="Light" />
<FluentTheme />
<StyleInclude Source="avares://Dock.Avalonia/Themes/DockFluentTheme.axaml" />
<Style Selector="TextBlock">
<Setter Property="HorizontalAlignment" Value="Center" />
Expand Down
5 changes: 3 additions & 2 deletions samples/Notepad/App.axaml
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
<Application xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:Notepad"
x:Class="Notepad.App"
Name="Notepad"
x:Class="Notepad.App">
RequestedThemeVariant="Light">
<Application.DataTemplates>
<local:ViewLocator />
</Application.DataTemplates>
<Application.Styles>
<FluentTheme Mode="Light" />
<FluentTheme />
<StyleInclude Source="avares://Dock.Avalonia/Themes/DockFluentTheme.axaml" />
</Application.Styles>
</Application>
35 changes: 20 additions & 15 deletions src/Dock.Avalonia/Controls/DockableControl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
using Avalonia.Controls;
using Avalonia.Input;
using Avalonia.Interactivity;
using Avalonia.Reactive;
using Dock.Avalonia.Internal;
using Dock.Model.Core;

Expand Down Expand Up @@ -37,25 +38,29 @@ protected override void OnAttachedToVisualTree(VisualTreeAttachmentEventArgs e)
{
base.OnAttachedToVisualTree(e);

_dataContextDisposable = this.GetObservable(DataContextProperty).Subscribe((dataContext) =>
{
if (_currentDockable is not null)
{
UnRegister(_currentDockable);
_currentDockable = null;
}

if (dataContext is IDockable dockableChanged)
{
_currentDockable = dockableChanged;
Register(dockableChanged);
}
});
_dataContextDisposable = this.GetObservable(DataContextProperty).Subscribe(
new AnonymousObserver<object?>(DataContextTracking));

AddHandler(PointerPressedEvent, PressedHandler, RoutingStrategies.Tunnel);
AddHandler(PointerMovedEvent, MovedHandler, RoutingStrategies.Tunnel);

_boundsDisposable = this.GetObservable(BoundsProperty).Subscribe(SetBoundsTracking);
_boundsDisposable = this.GetObservable(BoundsProperty).Subscribe(
new AnonymousObserver<Rect>(SetBoundsTracking));
}

private void DataContextTracking(object? dataContext)
{
if (_currentDockable is not null)
{
UnRegister(_currentDockable);
_currentDockable = null;
}

if (dataContext is IDockable dockableChanged)
{
_currentDockable = dockableChanged;
Register(dockableChanged);
}
}

/// <inheritdoc/>
Expand Down
4 changes: 1 addition & 3 deletions src/Dock.Avalonia/Controls/DocumentTabStrip.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,7 @@
</Path>
</Button>
<ItemsPresenter x:Name="PART_ItemsPresenter"
Items="{TemplateBinding Items}"
ItemsPanel="{TemplateBinding ItemsPanel}"
ItemTemplate="{TemplateBinding ItemTemplate}" />
ItemsPanel="{TemplateBinding ItemsPanel}" />
</DockPanel>
</ControlTemplate>
</Setter>
Expand Down
8 changes: 2 additions & 6 deletions src/Dock.Avalonia/Controls/DocumentTabStrip.axaml.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
using System;
using Avalonia;
using Avalonia.Controls;
using Avalonia.Controls.Generators;
using Avalonia.Controls.Metadata;
using Avalonia.Controls.Primitives;
using Avalonia.Styling;
Expand Down Expand Up @@ -56,12 +55,9 @@ public DocumentTabStrip()
}

/// <inheritdoc/>
protected override IItemContainerGenerator CreateItemContainerGenerator()
protected override Control CreateContainerForItemOverride()
{
return new ItemContainerGenerator<DocumentTabStripItem>(
this,
ContentControl.ContentProperty,
ContentControl.ContentTemplateProperty);
return new DocumentTabStripItem();
}

/// <inheritdoc/>
Expand Down
3 changes: 0 additions & 3 deletions src/Dock.Avalonia/Controls/HostWindow.axaml.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
using System;
using System.ComponentModel;
using System.Reactive.Linq;
using System.Runtime.InteropServices;
using Avalonia;
using Avalonia.Controls;
using Avalonia.Controls.Chrome;
using Avalonia.Controls.Metadata;
using Avalonia.Controls.Primitives;
using Avalonia.Input;
Expand Down
4 changes: 1 addition & 3 deletions src/Dock.Avalonia/Controls/ToolTabStrip.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,7 @@
Padding="{TemplateBinding Padding}"
DockPanel.Dock="Left">
<ItemsPresenter Name="PART_ItemsPresenter"
Items="{TemplateBinding Items}"
ItemsPanel="{TemplateBinding ItemsPanel}"
ItemTemplate="{TemplateBinding ItemTemplate}" />
ItemsPanel="{TemplateBinding ItemsPanel}"/>
</Border>
<Border Name="PART_BorderFill" />
</DockPanel>
Expand Down
8 changes: 3 additions & 5 deletions src/Dock.Avalonia/Controls/ToolTabStrip.axaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,12 @@ public ToolTabStrip()
}

/// <inheritdoc/>
protected override IItemContainerGenerator CreateItemContainerGenerator()
protected override Control CreateContainerForItemOverride()
{
return new ItemContainerGenerator<ToolTabStripItem>(
this,
ContentControl.ContentProperty,
ContentControl.ContentTemplateProperty);
return new ToolTabStripItem();
}


/// <inheritdoc/>
protected override void OnPropertyChanged(AvaloniaPropertyChangedEventArgs change)
{
Expand Down

0 comments on commit 6ac3587

Please sign in to comment.