Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
jamsoft committed Apr 22, 2024
2 parents d75fd5d + 4359a90 commit 18cbef0
Show file tree
Hide file tree
Showing 20 changed files with 652 additions and 259 deletions.
19 changes: 13 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,16 @@ https://jamsoft.github.io/JamSoft.AvaloniaUI.Dialogs/

## Installation
```shell
dotnet add package JamSoft.AvaloniaUI.Dialogs --version 1.1.4
dotnet add package JamSoft.AvaloniaUI.Dialogs --version 1.2.0
```
```shell
Install-Package JamSoft.AvaloniaUI.Dialogs -Version 1.1.4
Install-Package JamSoft.AvaloniaUI.Dialogs -Version 1.2.0
```
```xml
<PackageReference Include="JamSoft.AvaloniaUI.Dialogs" Version="1.1.4" />
<PackageReference Include="JamSoft.AvaloniaUI.Dialogs" Version="1.2.0" />
```
```shell
paket add JamSoft.AvaloniaUI.Dialogs --version 1.1.4
paket add JamSoft.AvaloniaUI.Dialogs --version 1.2.0
```
## Import Styles
### All Defaults
Expand Down Expand Up @@ -368,7 +368,8 @@ See the Sample Application for a complete implementation example and guidance.
You can easily target elements of the dialogs via their names and types, such as:
```xml
<Application>
<Application.Styles>
<Application.Styles>

<Style Selector="Button.CloseChildButton:pointerover /template/ Border">
<Setter Property="Background" Value="#c42b1c" />
</Style>
Expand All @@ -382,7 +383,13 @@ You can easily target elements of the dialogs via their names and types, such as
<Setter Property="FontSize" Value="12"/>
<Setter Property="VerticalAlignment" Value="Center" />
<Setter Property="Margin" Value="10,0"/>
</Style>
</Style>

<Style Selector="controls|WizardStep:complete /template/ Ellipse#PART_SelectedPipe">
<Setter Property="Fill" Value="DeepPink" />
<Setter Property="StrokeThickness" Value="0" />
</Style>

</Application.Styles>
</Application>
```
14 changes: 9 additions & 5 deletions src/JamSoft.AvaloniaUI.Dialogs.Sample/App.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,11 @@
x:Class="JamSoft.AvaloniaUI.Dialogs.Sample.App">

<Application.Styles>
<FluentTheme Mode="Dark"/>
<FluentTheme>
<FluentTheme.Palettes>
<ColorPaletteResources x:Key="Dark" Accent="DarkGreen" RegionColor="Black" ErrorText="Yellow" />
</FluentTheme.Palettes>
</FluentTheme>
<StyleInclude Source="avares://JamSoft.AvaloniaUI.Dialogs/Themes/Default.axaml"/>

<Style Selector="Window">
Expand All @@ -15,9 +19,9 @@
<Setter Property="HorizontalAlignment" Value="Center"/>
</Style>

<Style Selector="controls|WizardStep:complete /template/ Ellipse#PART_SelectedPipe">
<Setter Property="Fill" Value="DeepPink" />
<Setter Property="StrokeThickness" Value="0" />
</Style>
<!-- <Style Selector="controls|WizardStep:complete /template/ Ellipse#PART_SelectedPipe"> -->
<!-- <Setter Property="Fill" Value="DeepPink" /> -->
<!-- <Setter Property="StrokeThickness" Value="0" /> -->
<!-- </Style> -->
</Application.Styles>
</Application>
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<Nullable>enable</Nullable>
<BuiltInComInteropSupport>true</BuiltInComInteropSupport>
<ApplicationManifest>app.manifest</ApplicationManifest>
<LangVersion>12</LangVersion>
<ApplicationIcon>Assets\avalonia-logo.ico</ApplicationIcon>
</PropertyGroup>

<ItemGroup>
Expand All @@ -18,15 +20,15 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Avalonia" Version="0.10.21" />
<PackageReference Include="Avalonia.Desktop" Version="0.10.21" />
<PackageReference Include="Avalonia" Version="11.0.6" />
<PackageReference Include="Avalonia.Desktop" Version="11.0.6" />
<PackageReference Include="Avalonia.Diagnostics" Version="11.0.6" />
<!--Condition below is needed to remove Avalonia.Diagnostics package from build output in Release configuration.-->
<PackageReference Condition="'$(Configuration)' == 'Debug'" Include="Avalonia.Diagnostics" Version="0.10.18" />
<PackageReference Include="Avalonia.ReactiveUI" Version="0.10.21" />
<PackageReference Include="Avalonia.ReactiveUI" Version="11.0.6" />
<PackageReference Include="Avalonia.Themes.Fluent" Version="11.0.6" />
<PackageReference Include="JamSoft.Helpers" Version="1.3.0" />
<PackageReference Include="JamSoft.Helpers.AvaloniaUI" Version="1.1.4" />
<PackageReference Include="Splat" Version="14.6.37" />
<PackageReference Include="XamlNameReferenceGenerator" Version="1.6.1" />
<PackageReference Include="JamSoft.Helpers.AvaloniaUI" Version="1.2.1" />
<PackageReference Include="Splat" Version="14.8.12" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
using System;
using System.ComponentModel;
using System.Windows.Input;
using Avalonia;
using Avalonia.Controls;
using Avalonia.Media;
using Avalonia.Media.Imaging;
Expand All @@ -20,9 +19,7 @@ public CustomBaseChildWindowViewModel()
{
AcceptCommand = new DelegateCommand(null, null);
CancelCommand = new DelegateCommand(null, null);

var assets = AvaloniaLocator.Current.GetService<IAssetLoader>();
CloseIcon = new Bitmap(assets?.Open(new Uri("avares://JamSoft.AvaloniaUI.Dialogs/Assets/CloseIcon/icons8-close-30.png")));
CloseIcon = new Bitmap(AssetLoader.Open(new Uri("avares://JamSoft.AvaloniaUI.Dialogs/Assets/CloseIcon/icons8-close-30.png")));

_cancelCommand = new DelegateCommand(() => InvokeRequestCloseDialog(new RequestCloseDialogEventArgs(false)), CanCancel);
CancelCommandText = "Cancel";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using System.Collections.Generic;
using System.Windows.Input;
using Avalonia.Controls;
using Avalonia.Platform.Storage;
using JamSoft.AvaloniaUI.Dialogs.Commands;
using JamSoft.AvaloniaUI.Dialogs.Helpers;
using JamSoft.AvaloniaUI.Dialogs.Sample.Models;
Expand All @@ -14,7 +15,6 @@ namespace JamSoft.AvaloniaUI.Dialogs.Sample.ViewModels;
public class MainWindowViewModel : ViewModelBase
{
private readonly IDialogService _dialogService;
private string? _message;
private ICommand? _openFileCommand;
private ICommand? _openWordFileCommand;
private ICommand? _saveFileCommand;
Expand All @@ -29,7 +29,8 @@ public class MainWindowViewModel : ViewModelBase
private ICommand? _childWindowRememberPositionCommand;
private ICommand? _missingViewCommand;
private ICommand? _wizardViewCommand;

private string? _message;

public MainWindowViewModel(IDialogService dialogService)
{
_dialogService = dialogService;
Expand Down Expand Up @@ -137,12 +138,6 @@ public ICommand? SaveWordFileCommand
set => this.RaiseAndSetIfChanged(ref _saveWordFileCommand, value);
}

public string? Message
{
get => _message;
set => this.RaiseAndSetIfChanged(ref _message, value);
}

public ICommand? OpenFileCommand
{
get => _openFileCommand;
Expand All @@ -155,14 +150,20 @@ public ICommand? OpenWordFileCommand
set => this.RaiseAndSetIfChanged(ref _openWordFileCommand, value);
}

public string? Message
{
get => _message;
set => this.RaiseAndSetIfChanged(ref _message, value);
}

private async void OpenFileCommandExecuted()
{
Message = await _dialogService.OpenFile("Open Any File");
}

private async void OpenWordFileCommandExecuted()
{
Message = await _dialogService.OpenFile("Open Word File", new List<FileDialogFilter>
Message = await _dialogService.OpenFile("Open Word File", new List<FilePickerFileType>
{
CommonFilters.WordFilter
});
Expand All @@ -180,7 +181,7 @@ private async void SaveFileCommandExecuted()

private async void SaveWordFileCommandExecuted()
{
Message = await _dialogService.SaveFile("Save Word File", new List<FileDialogFilter>
Message = await _dialogService.SaveFile("Save Word File", new List<FilePickerFileType>
{
CommonFilters.WordFilter
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

<StackPanel Spacing="20">
<TextBox Text="{Binding ChildMessage}" Height="25" />
<ComboBox Items="{Binding ComboboxItems}"
<ComboBox ItemsSource="{Binding ComboboxItems}"
SelectedItem="{Binding SelectedItem}">
<ComboBox.ItemTemplate>
<DataTemplate DataType="viewModels:ComboBoxItemViewModel">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@
x:Class="JamSoft.AvaloniaUI.Dialogs.Sample.Views.MyWizardView">

<controls:Wizard ButtonPlacement="Bottom"
ProgressPlacement="Top"
ProgressPlacement="Bottom"
CompleteButtonContent="Submit Wizard">

<controls:WizardStep Header="Page 1" StepComplete="{Binding WizardStepOneComplete}">
<controls:WizardStep.Content>
<StackPanel Orientation="Vertical" Spacing="20">
<TextBlock>Page 1</TextBlock>
<TextBox Foreground="White" Text="{Binding ValueOne}"/>
<ComboBox Items="{Binding ComboboxItems}"
<ComboBox ItemsSource="{Binding ComboboxItems}"
SelectedItem="{Binding SelectedItem}">
<ComboBox.ItemTemplate>
<DataTemplate DataType="viewModels:ComboBoxItemViewModel">
Expand Down Expand Up @@ -54,7 +54,7 @@
</StackPanel>
</controls:WizardStep.Content>
</controls:WizardStep>

</controls:Wizard>

</UserControl>
Loading

0 comments on commit 18cbef0

Please sign in to comment.