Skip to content
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

Upgrade to winapp11 #213

Draft
wants to merge 82 commits into
base: main
Choose a base branch
from
Draft

Upgrade to winapp11 #213

wants to merge 82 commits into from

Conversation

hoffe86
Copy link
Collaborator

@hoffe86 hoffe86 commented Dec 17, 2023

No description provided.

hoffe86 and others added 30 commits June 5, 2022 21:59
Signed-off-by: Christoph Hofmann <oss@hoffe.org>
Signed-off-by: Christoph Hofmann <oss@hoffe.org>
Signed-off-by: Christoph Hofmann <oss@hoffe.org>
Signed-off-by: Christoph Hofmann <oss@hoffe.org>
Signed-off-by: Christoph Hofmann <oss@hoffe.org>
Signed-off-by: Christoph Hofmann <oss@hoffe.org>
Signed-off-by: Christoph Hofmann <oss@hoffe.org>
Signed-off-by: Christoph Hofmann <oss@hoffe.org>
Signed-off-by: Christoph Hofmann <oss@hoffe.org>
- Reorganized files

Signed-off-by: Christoph Hofmann <oss@hoffe.org>
Signed-off-by: Christoph Hofmann <oss@hoffe.org>
# Conflicts:
#	src/openHAB.Core/Openhab.Core.csproj
#	src/openHAB.Core/Strings/de-de/Resources.resw
#	src/openHAB.Windows/Controls/ConnectionDialog.xaml
#	src/openHAB.Windows/Converters/OpenHabUrlStateToGlyph.cs
#	src/openHAB.Windows/ViewModel/MainViewModel.cs
#	src/openHAB.Windows/openHAB.Windows.csproj
Signed-off-by: Christoph Hofmann <oss@hoffe.org>
Signed-off-by: Christoph Hofmann <oss@hoffe.org>
Signed-off-by: Christoph Hofmann <oss@hoffe.org>
Signed-off-by: Christoph Hofmann <oss@hoffe.org>
Signed-off-by: Christoph Hofmann <oss@hoffe.org>
Signed-off-by: Christoph Hofmann <oss@hoffe.org>
Signed-off-by: Christoph Hofmann <oss@hoffe.org>
Signed-off-by: Christoph Hofmann <oss@hoffe.org>
Signed-off-by: Christoph Hofmann <oss@hoffe.org>

# Conflicts:
#	.sonarlint/OpenHAB.Windows.slconfig
#	.sonarlint/openhab_openhab-windowscsharp.ruleset
#	src/openHAB.Core/Openhab.Core.csproj
#	src/openHAB.Core/SDK/OpenHABClient.cs
#	src/openHAB.Windows/Controls/ConnectionDialog.xaml
#	src/openHAB.Windows/Converters/OpenHabUrlStateToGlyph.cs
#	src/openHAB.Windows/DIService.cs
#	src/openHAB.Windows/ViewModel/MainViewModel.cs
#	src/openHAB.Windows/openHAB.Windows.csproj
Signed-off-by: Christoph Hofmann <oss@hoffe.org>
Signed-off-by: Christoph Hofmann <oss@hoffe.org>
Signed-off-by: Christoph Hofmann <oss@hoffe.org>
Signed-off-by: Christoph Hofmann <oss@hoffe.org>
Signed-off-by: Christoph Hofmann <oss@hoffe.org>
Signed-off-by: Christoph Hofmann <oss@hoffe.org>
Signed-off-by: Christoph Hofmann <oss@hoffe.org>
Signed-off-by: Christoph Hofmann <oss@hoffe.org>
Signed-off-by: Christoph Hofmann <oss@hoffe.org>
Signed-off-by: Christoph Hofmann <oss@hoffe.org>
Signed-off-by: Christoph Hofmann <oss@hoffe.org>
Signed-off-by: Christoph Hofmann <oss@hoffe.org>
Signed-off-by: Christoph Hofmann <oss@hoffe.org>
Signed-off-by: Christoph Hofmann <oss@hoffe.org>
Signed-off-by: Christoph Hofmann <oss@hoffe.org>
Signed-off-by: Christoph Hofmann <oss@hoffe.org>
Signed-off-by: Christoph Hofmann <oss@hoffe.org>
Signed-off-by: Christoph Hofmann <oss@hoffe.org>
Signed-off-by: Christoph Hofmann <oss@hoffe.org>
Signed-off-by: Christoph Hofmann <oss@hoffe.org>
Signed-off-by: Christoph Hofmann <oss@hoffe.org>
Signed-off-by: Christoph Hofmann <oss@hoffe.org>
Signed-off-by: Christoph Hofmann <oss@hoffe.org>
Signed-off-by: Christoph Hofmann <oss@hoffe.org>
…t reference for "openHAB.Common", removal of namespaces from "NotificationManager.cs", addition of a new parameter in "ResolveIconPath" method, and the inclusion of a new dependency in "IconCaching.cs". Several converters were removed from "App.xaml" and usage of certain converters was removed from multiple files. The logic for resolving the icon path was updated in "ImageLabel.xaml.cs" and a boolean return type was added to "DownloadAndSaveIconToCache" method in "IconCaching.cs". Code formatting and alignment changes were made in multiple files for better readability. The type of `Widget` property was changed in `WidgetBase.cs` and the logic for generating the icon path was simplified in `IconToBitmapConverter.cs`. The `Visibility` property binding was simplified in all `.xaml` files. The `IconToPathConverter.cs`, `StringToColorBrushConverter.cs` files were removed from the project. Various UI elements were updated in `MainWindow.xaml` and a `nativeDebugging` property was added to the `openHAB.Windows (Package)` profile in `launchSettings.json`. A new file `WidgetViewModel.cs` was added to the project.

Here is a list of the changes:

1. The project reference for "openHAB.Common" was updated to use a different project type GUID.
2. The "openHAB.Core.Client" and "openHAB.Core.Common" namespaces were removed from the "NotificationManager.cs" file.
3. The method signature for "ResolveIconPath" in "IIconCaching.cs" was updated to include a new parameter for "state".
4. The "IconCaching.cs" file was updated to include a new dependency on "ISettingsService", and the "ResolveIconPath" method was updated to construct the icon URL based on the server version and state.
5. Several converters were removed from "App.xaml".
6. The "ChartWidget.xaml", "ColorWidget.xaml", "FrameWidget.xaml", "ImageWidget.xaml", "MapViewWidget.xaml", "MjpegWidget.xaml", "PageLinkWidget.xaml", "RollershutterWidget.xaml", and "SectionSwitchWidget.xaml" files were updated to remove usage of the "BooleanToVisibilityConverter", "IconToPathConverter", and "StringToColorConverter". The "IconPath" property is now directly bound to the "IconPath" property of the widget.
7. The "ImageLabel.xaml.cs" file was updated to remove the dependency on "IIconCaching" and to update the logic for resolving the icon path.
8. The "DownloadAndSaveIconToCache" method in "IconCaching.cs" was updated to return a boolean indicating whether the download was successful.
9. Code formatting and alignment changes were made in multiple files for better readability.
10. The type of `Widget` property was changed in `WidgetBase.cs` and the logic for generating the icon path was simplified in `IconToBitmapConverter.cs`.
11. The `Visibility` property binding was simplified in all `.xaml` files.
12. The `IconToPathConverter.cs`, `StringToColorBrushConverter.cs` files were removed from the project.
13. Various UI elements were updated in `MainWindow.xaml` and a `nativeDebugging` property was added to the `openHAB.Windows (Package)` profile in `launchSettings.json`.
14. A new file `WidgetViewModel.cs` was added to the project.
…C# version, renaming of classes, replacement of the JSON library, and updates to package versions.

1. The `openHAB.Core.Client.csproj` file has been updated to target the .NET Standard 2.0 framework and use C# version 11.0. It also includes additional project sources for package restoration and adds package references for `Azure.Core` and `Microsoft.Azure.AutoRest.CSharp`.

2. The `openHAB.Common.csproj` file has been updated to use newer versions of the `Microsoft.WindowsAppSDK` and `Microsoft.Windows.SDK.BuildTools` packages.

3. Several classes have been renamed, such as `OpenHABSitemap` to `Sitemap`, `OpenHABItem` to `Item`, and `OpenHABWidget` to `WidgetViewModel`. This suggests a simplification or standardization of class names.

4. The JSON library used for serialization and deserialization has been changed from `Newtonsoft.Json` to `System.Text.Json.Serialization`.

5. The versions of several package references, such as `Microsoft.WindowsAppSDK`, `Microsoft.Windows.SDK.BuildTools`, and `Microsoft.Extensions.Logging.Abstractions`, have been updated.

6. The namespace `openHAB.Core.Services` was changed to `openHAB.Windows.Services` in `WidgetNavigationService.cs`, `MainPage.xaml.cs`, and `SitemapPage.xaml.cs`.

7. The `Page` class was replaced with `Microsoft.UI.Xaml.Controls.Page` in `MainPage.xaml.cs` and `SitemapPage.xaml.cs`.

8. The `WigetNavigation` class was replaced with `WidgetNavigationMessage` in `MainViewModel.cs` and `SitemapViewModel.cs`.

9. The `ObservableCollection<OpenHABWidget>` was replaced with `ObservableCollection<WidgetViewModel>` in `MainViewModel.cs`.

10. The `ObservableCollection<OpenHABSitemap>` was replaced with `ObservableCollection<Sitemap>` in `MainViewModel.cs`.

11. The `List<OpenHABSitemap>` was replaced with `List<Sitemap>` in `MainViewModel.cs`.

12. The `ICollection<OpenHABWidget>` was replaced with `ICollection<Widget>` in `SitemapViewModel.cs`.

13. The `ICollection<OpenHABWidgetMapping>` was replaced with `ICollection<WidgetMapping>` in `SitemapViewModel.cs`.

14. The `OpenHABItem` class was replaced with `Item` in `WidgetViewModel.cs`.

15. The `ObservableCollection<WidgetViewModel>` was added to `WidgetViewModel.cs`.

16. The `Encoding` property was added to `WidgetViewModel.cs`.

17. The `Parent` property was added to `WidgetViewModel.cs`.

18. The `Visibility` property was added to `WidgetViewModel.cs`.

19. The `CreateAsync` method was added to `WidgetViewModel.cs`.

20. The `LoadData` method was added to `WidgetViewModel.cs`.

21. The `CacheAndRetrieveLocalIconPath` method was added to `WidgetViewModel.cs`.

22. The `ConvertColorCodeToColor` method was added to `WidgetViewModel.cs`.

23. The version of the `Mapsui` and `Mapsui.WinUI` packages in the `openHAB.Windows.csproj` file have been updated from `4.1.3` to `4.1.4`.

24. The version of the `Microsoft.WindowsAppSDK` package in the `openHAB.Windows.csproj` file has been updated from `1.4.231219000` to `1.5.240311000`.
…renceMessenger.Default.Send` and `StrongReferenceMessenger.Default.Register` method calls in `MainWindow.xaml.cs`, `MainViewModel.cs`, and `SitemapViewModel.cs`. These methods now include additional arguments related to the sitemap name. Additionally, the `StrongReferenceMessenger.Default.Unregister` method call was removed from `MainViewModel.cs`. Lastly, several build properties were removed from `openHAB.Windows.GeneratedMSBuildEditorConfig.editorconfig`, indicating potential changes in the project configuration or build process.

List of changes:

1. The namespaces `System` and `System.Threading.Tasks` were removed and then added back in `MainWindow.xaml.cs` and `SitemapViewModel.cs`. This could be due to reordering of the namespaces.
2. The `StrongReferenceMessenger.Default.Send` method calls in `MainWindow.xaml.cs` were modified to include `Vm.SelectedSitemap.Name` as an additional argument.
3. The `StrongReferenceMessenger.Default.Register` method calls in `MainViewModel.cs` and `SitemapViewModel.cs` were modified to include the sitemap name as an additional argument.
4. The `StrongReferenceMessenger.Default.Unregister` method call in `MainViewModel.cs` was removed.
5. The `StrongReferenceMessenger.Default.Send` method calls in `SitemapViewModel.cs` were modified to include `Model.Name` as an additional argument.
6. Several build properties were removed from `openHAB.Windows.GeneratedMSBuildEditorConfig.editorconfig`. This could be due to changes in the project configuration or build process.
…image source binding in `FrameWidget.xaml`, the removal of color converter usage in `SelectionWidget.xaml`, and the addition of a `RaisePropertyChanged` call in `TextWidget.xaml.cs`. Other notable changes include the handling of null values and case-insensitive comparison in `ToggleWidget.xaml.cs` and `WidgetViewModel.cs`, and the replacement of `VariableSizedWrapGrid` with a `WrapPanel` in `SitemapPage.xaml`.

1. `FrameWidget.xaml`: The image source has been changed from using a converter to directly binding to the `Widget.Icon` property.
2. `SelectionWidget.xaml`: The `LabelForeground` and `Foreground` properties have been updated to remove the use of a color converter.
3. `TextWidget.xaml.cs`: A `RaisePropertyChanged` call has been added to the `SetState` method.
4. `ToggleWidget.xaml.cs`: The `Loading` event handler has been commented out, and the `State` property has been updated to handle null values and use case-insensitive comparison. The `SetState` method has also been significantly simplified.
5. `IconToBitmapConverter.cs`: The converter now returns null instead of an empty string when the widget is null or has no icon path.
6. `StateToBoolConverter.cs`: The comparison of the value to `OpenHABCommands.OnCommand` is now case-insensitive.
7. `MainWindow.xaml`: The refresh button has been commented out.
8. `SitemapPage.xaml`: The `Margin` property of the `MainContentGrid` has been updated, and the `ItemWidth` and `Orientation` properties of the `VariableSizedWrapGrid` have been commented out. A `WrapPanel` from the Community Toolkit has been added as a replacement.
9. `WidgetViewModel.cs`: The order of the using directives has been changed, and the `Icon` property has been updated to return an `SvgImageSource` instead of a string. The `State` property has also been updated to handle null values.
Updated package references in multiple project files, including `Microsoft.WindowsAppSDK` and `Microsoft.Windows.SDK.BuildTools`. Added new resource entry for `MenuItemMainUI.Content`. Cleaned up unused `using` directives and namespaces. Modified `MainWindow.xaml` to use `Binding` instead of `x:Bind` and added a new `NavigationViewItem` for `MainUI`. Added event handler for `MainUIPage` navigation. Removed `WinUIPage` and introduced `MainUIPage` with `WebView2` control. Updated project files accordingly. Made minor UI changes in `SitemapPage.xaml` and cleaned up unused XML namespaces in `MainPage.xaml`. Upgraded `Mapsui` packages to version `4.1.6`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant