-
Notifications
You must be signed in to change notification settings - Fork 36
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Avalonia v11.0.0-preview4 #31
Conversation
…onia.Themes.Fluent to SampleApp.props, its now a separate package.
@DamianSuess Great job. Is it ready to merge? |
Not yet, thanks for asking. Figured I'd make a PR marked as |
I encountered an interesting error in the SampleMvvmApp project after upgrading to Avalonia v11.0.0-pre4. The DashboardView's Error Message:
Considerations:We could modify the Another option, when users set x:CompileBindings="True" they will be informed of these hidden XAML errors at compile time, and their apps won't crash. Though this option works, it would be good for Prism.Avalonia to report Any thoughts or other options? App.xaml.cs protected override void OnInitialized()
{
var regionManager = Container.Resolve<IRegionManager>();
// Error in missing `DataType` gets picked up inside here
regionManager.RegisterViewWithRegion(RegionNames.ContentRegion, typeof(DashboardView));
regionManager.RegisterViewWithRegion(RegionNames.SidebarRegion, typeof(SidebarView));
} DashboardView.xaml <ListBox Margin="2"
VerticalAlignment="Bottom"
Items="{Binding ListItems}"
ScrollViewer.HorizontalScrollBarVisibility="Visible"
ScrollViewer.VerticalScrollBarVisibility="Visible"
SelectedIndex="{Binding ListItemSelected}"
SelectionMode="Single">
<ListBox.DataTemplates>
<DataTemplate>
<TextBlock Text="{Binding .}"
FontSize="10"
TextWrapping="NoWrap" />
</DataTemplate>
</ListBox.DataTemplates> After - Successful: <UserControl xmlns="https://github.com/avaloniaui"
...
xmlns:system="clr-namespace:System;assembly=mscorlib">
...
<ListBox.DataTemplates>
<DataTemplate DataType="{x:Type system:String}">
<TextBlock Text="{Binding .}"
FontSize="10"
TextWrapping="NoWrap" />
</DataTemplate>
</ListBox.DataTemplates> |
…t rules on DataTemplate DataType bindings
…dated NuGet description, replacing "Prism.WPF" typo with "Prism.Avalonia"
…Type. Skipping unimplemented `Selector` test
I believe the change is from this PR |
@rabbitism, great find! I was digging through PRs & change docs trying to find this. Dong, you win the internet for the week 🚀 Though I like the strongly typed nature of defining the Also including AvaloniaUI/Avalonia#8203 as a reference According to the PR's suggested error handling, it currently doesn't throw the exception during compile time. Only until |
@@ -33,7 +33,7 @@ public static AppBuilder BuildAvaloniaApp() | |||
}) | |||
.With(new Win32PlatformOptions | |||
{ | |||
EnableMultitouch = true, | |||
//// EnableMultitouch = true, // Not supported in Avalonia v11.0.0-preview4 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is always enabled now
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @maxkatz6 for the heads up. I updated the code comment to reflect your note
I fixe the ViewDiscovery sample to render, however, it is no longer auto-switching the views as it did w/ Avalonia v0.10.x. It appears that during the MainWindow's creation, it is not registering the To fix some of ViewDiscovery's AXML errors, I switched to Lite Theme, enabled compiled bindings, and moved View registration to the |
<PackageReference Include="Avalonia" Version="11.0.0-preview4" /> | ||
<PackageReference Include="Avalonia.Controls.DataGrid" Version="11.0.0-preview4" /> | ||
<PackageReference Include="Avalonia.Desktop" Version="11.0.0-preview4" /> | ||
<PackageReference Include="Avalonia.Diagnostics" Version="11.0.0-preview4" /> | ||
<!--<PackageReference Condition="'$(Configuration)' == 'Debug'" Include="Avalonia.Diagnostics" Version="11.0.0-preview4" />--> | ||
<PackageReference Include="Avalonia.LinuxFramebuffer" Version="11.0.0-preview4" /> | ||
<PackageReference Include="Avalonia.Markup.Xaml.Loader" Version="11.0.0-preview4" /> | ||
<PackageReference Include="Avalonia.ReactiveUI" Version="11.0.0-preview4" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems to be the list of dependencies that will be referenced with the Prism.Avalonia nuget package.
If so, I believe this list is excessive.
Most likely, for the mvvm framework you most likely only need main "Avalonia" package.
Note, that I have used Prism a very little before in WPF, so I might miss some details.
- Avalonia.Desktop - will block application to run only on Win, Mac and Lin. With the way how .NET dependencies work, this dependency unfortunately won't allow users to target Browser (WASM) projects.
- Avalonia.Controls.DataGrid, Avalonia.Diagnostics and Avalonia.Markup.Xaml.Loader - these should be harmless in general, but also bloat application size, when they are not used (that's why Diagnostics also disable for the release in our templates).
- Avalonia.LinuxFramebuffer - only makes sense if users want to target linux framebuffer, but should be harmless otherwise.
- Avalonia.ReactiveUI - probably isn't needed here. If Prism uses System.Reactive, this dependency should be added manually (note, Avalonia doesn't reference System.Reactive anymore, starting with coming soon preview5)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some of these packages still are needed for the sample project though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@maxkatz6 in the next preview 5 release of this repo, I'll trim those down. You're right, we should only be referencing the bare minimum, most of them aren't being used.
<ListBox.ItemTemplate> | ||
<!-- | ||
OLD: <DataTemplate> | ||
NEW: <DataTemplate DataType="{x:Type system:String}"> | ||
https://github.com/AvaloniaUI/Avalonia/pull/8221 | ||
--> | ||
<DataTemplate DataType="{x:Type system:String}"> | ||
<TextBlock Text="{Binding .}" | ||
FontSize="10" | ||
TextWrapping="NoWrap" /> | ||
</DataTemplate> | ||
</ListBox.DataTemplates> | ||
</ListBox.ItemTemplate> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note, you don't necessary need DataType, if you use ListBox.ItemTemplate instead ListBox.DataTemplates.
It won't cause any exceptions, as ListBox.ItemTemplate is way more specific and won't pollute children with the template.
Although, it's always a good idea to setup more strict types. Especially with x:CompileBindings.
For this PR, can you try to switch to nightly builds? I remember there were issues with ContentControl which possibly can cause problems like this (note, I haven't debugged this issue). Nightly builds, which should be shipped as preview5 in next weeks, some more breaking changes. But it also is expected to be last preview before release candidate. More about nightly builds you can find here: https://github.com/AvaloniaUI/Avalonia/wiki/Using-nightly-build-feed or bot comments like this AvaloniaUI/Avalonia#10058 (comment) |
@maxkatz6, you're the man! i'll give it a shot. Wow, i wasn't expecting such quick feedback. If we ever meet up at some conference, a round of drinks are on me 👍 |
hello all, just a heads up on the slow down.. When the spare time allows in between old man naps, I'll try and get out preview NuGet packages for you all to consume (Preview-4, and Nightly) as per MaxKatz's awesome suggestion. I apologize for the inconvenience |
…to denote Avalonia v11.0-preview4 support
Published v8.1.91.3-preview.11.4 to NuGet.org |
WOA. WONDERFUL. THANKSSSSSSS A LOT. GREAT JOB |
Add support for Avalonia v11.0.0-preview4
Action Items
References