Hi everyone!
Our team is hard at work on WinUI 3 Preview 2 and are excited to share it with you all as soon as possible. As we announced previously, Preview 2 will be a stability and quality focused release, with an emphasis on fixing bugs from Preview 1. In order to make sure that our work really focuses on our developers, I wanted to ask our community:
What are the serious and/or blocking bugs that you encountered in Preview 1?
As we work through bugs we want to make sure that we're fixing ones that will really impact your quality of life as a developer, so feel free to share any significant ones in the comments.
NOTE: Please "thumbs up" ones that you agree with/have also encountered! This makes it much easier for us to keep track.
Thanks!
Why don't you look through the repo to see the bugs people have reported in Preview 1?
Thorn on side: https://github.com/microsoft/microsoft-ui-xaml/issues/597
Support for System.Collections.Specialized.INotifyCollectionChanged
It's quite involved to try and rewrite your app currently to make it work, and a lot of View Models rely on observable collections to function. I gave up trying to port any current applications to WinUI, simply because significant rewrites were required. It was by far the single most biggest blocker for trying to run any existing code on WinUI.
System.Collections.Specialized.INotifyCollectionChanged is the biggest one that hides all the rest
Back on March 25th, I posted this (regarding the Alpha release):
Windows UI should support at least the major MVVM frameworks- MVVM Light, Prism, and Caliburn. Unfortunately, your documented problem with changes to INotifyPropertyChanged and INotifyCollectionChanged breaking ObservableCollection certainly breaks MVVM Light, and probably the other two frameworks as well. Thought you should know.
(https://github.com/microsoft/microsoft-ui-xaml/issues/1045)
If the goal is 'one UI to bind them all', you need to maintain enough compatibility that developers aren't chasing some moving target you keep shifting. How many projects do you think uses these frameworks?
I'd also like to see you bring some love for WinRT back into Win UI. The Win32 support is lovely, but where did WinRT go? And why?
@terrycox, what lack of WinRT love are you referring to?
The Alpha documentation contained procedures and templates for updating WinRT apps to use Win UI 3. All of that disappeared in Preview 1, which had templates for Win32 apps, but no templates for UWP progs, and no mention in the documentation whatsoever.
I understand that the focus was on the new bits, Win32, and that the code didn't vanish, but it was disconcerting to see WinRT references disappear altogether.
The documentation and templates in the Alpha disappeared in Preview 1. The bits were still there, but all the WinRT stuff- nope. I realize the focus was on the new stuff (Win32), but hey.
@terrycox huh? It's not just Win32. The WinUI UWP templates are still there.
I have played around with Validation. It is quite instable. It crashes a lot.
I'm using an improved version of ValidationBase baseclass with an extra AllError property. Use it for a kind of 'Validation Summary' (ListView)
public class ValidationBase : INotifyPropertyChanged, INotifyDataErrorInfo {
public event PropertyChangedEventHandler PropertyChanged;
public event EventHandler<DataErrorsChangedEventArgs> ErrorsChanged;
protected void SetValue<T>(ref T currentValue, T newValue, [CallerMemberName] string propertyName = "") {
if (!EqualityComparer<T>.Default.Equals(currentValue, newValue)) {
currentValue = newValue;
OnPropertyChanged(propertyName, newValue);
}
}
readonly Dictionary<string, List<ValidationResult>> _errors = new Dictionary<string, List<ValidationResult>>();
public bool HasErrors {
get {
return _errors.Any();
}
}
public IEnumerable GetErrors(string propertyName) {
return _errors[propertyName];
}
private void OnPropertyChanged(string propertyName, object value) {
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
Validate(propertyName, value);
}
private void AddErrors(string propertyName, IEnumerable<ValidationResult> results) {
if (!_errors.TryGetValue(propertyName, out List<ValidationResult> errors)) {
errors = new List<ValidationResult>();
_errors.Add(propertyName, errors);
}
errors.AddRange(results);
ErrorsChanged?.Invoke(this, new DataErrorsChangedEventArgs(propertyName));
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(nameof(AllErrors)));
}
private void ClearErrors(string propertyName) {
if (_errors.TryGetValue(propertyName, out List<ValidationResult> errors)) {
errors.Clear();
ErrorsChanged?.Invoke(this, new DataErrorsChangedEventArgs(propertyName));
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(nameof(AllErrors)));
}
}
public void Validate(string memberName, object value) {
ClearErrors(memberName);
List<ValidationResult> results = new List<ValidationResult>();
bool result = Validator.TryValidateProperty(
value,
new ValidationContext(this, null, null)
{
MemberName = memberName
},
results
);
if (!result) {
AddErrors(memberName, results);
}
}
public IEnumerable<ValidationResult> AllErrors => _errors.Values.SelectMany(v => v);
}
public class Employee : ValidationBase {
private string name;
private double _salary;
public Employee(string name, double salary) {
Name = name;
Salary = salary;
}
[MinLength(4)]
[MaxLength(6)]
public string Name {
get { return name; }
set { SetValue(ref name, value); }
}
[Range(0, 10000)]
public double Salary {
get { return _salary; }
set { SetValue(ref _salary, value); }
}
}
<Page x:Class="App23.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="using:App23"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
Background="{ThemeResource ApplicationPageBackgroundThemeBrush}"
mc:Ignorable="d">
<StackPanel HorizontalAlignment="Center"
VerticalAlignment="Center"
Spacing="12"
Width="300"
Orientation="Vertical">
<TextBox Text="{x:Bind Employee.Name, Mode=TwoWay}" />
<NumberBox Value="{x:Bind Employee.Salary, Mode=TwoWay}" />
<Button x:Name="myButton" Click="myButton_Click">Click Me</Button>
<ListView ItemsSource="{x:Bind Employee.AllErrors, Mode=OneWay}" />
</StackPanel>
</Page>
Why don't you look through the repo to see the bugs people have reported in Preview 1?
Oh we definitely are! I put this issue together so that we have an easy way of seeing peoples biggest blockers. Using an issue like this is also a tool that helps aggregate upvotes on issues, which gives us an easier view into how widespread the issue is.
Thanks @anawishnoff for creating this issue. Addressing bugs has been a long standing problem with UWP and I'm glad to finally see them being addressed head-on and talked about.
A focus here will ensure WinUI 3.0 is smooth for developers to use. I look forward to trying out future previews!
Hi Ana,
We have been unable to get the FilePicker/FolderPicker to work, and opening files is the starting point for our application.
The sample code in the WinUI-3-Demos repository crashes after clicking "Select Folder".
For more information, I created an issue on the WinUI-3-Demos repository: Issue 3!
Webview2 is always on top of other controls so other controls with animations are hidden behind the webview2 control. I think this used to be called the 'Airspace problem'.
Win2D! Not that this is a bug, but it would be a much-needed addition to Preview 2, rather than waiting until later.
It would be great if x:Uid
could be fixed (#2602 ), both UWP and Desktop.
Not sure if it qualifies as a bug, but can you please add header files and idl files for WRL? These are required to get win2d working (see https://github.com/microsoft/Win2D/issues/707). I created them manually from the .winmd file (not sure if I did it correctly) but a lot of manual editing was required afterwards.
TreeView with derived TreeViewNodes crashes in WinUI3 Desktop #2699
DataGrid Not Displaying in WinUI3 Desktop #2703
Unable to Enter Text into TextBox inside ContentDialog in WinUI3 Desktop #2704
NavigationView inside ContentDialog causes crash in WinUI3 Desktop #2713
Change in Appearance of AppBarButton with Flyout on CommandBar in WinUI3 Desktop #2714
Unable to drop files onto Grid in WinUI3 Desktop #2715
FileOpenPicker, FileSavePicker, and FolderPicker break in WinUI3 Desktop #2716
Not exactly a blocking bug, but would be nice to have the TitleBar customization back in Preview 2!
Window.SetTitleBar method is missed in WinUI/Uwp #2559
Working ObservableCollections is a must!
It would be nice to see some progress on Dispatcher too.
Unable to drop items from ListView onto Grid in WinUI3 Desktop #2782
Unable to move item (drag and drop) inside TreeView in WinUI3 Desktop #2783
Any news on the Preview 2 release date, with working observable collections ;) ?
@Wigmund Tune into today's WinUI Community Call, if possible (Preview 2 seems quite close to release by now).
Most helpful comment
Support for
System.Collections.Specialized.INotifyCollectionChanged
It's quite involved to try and rewrite your app currently to make it work, and a lot of View Models rely on observable collections to function. I gave up trying to port any current applications to WinUI, simply because significant rewrites were required. It was by far the single most biggest blocker for trying to run any existing code on WinUI.