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

Using DetailsListView from Uno.CommunityToolkit.WinUI.UI.Controls ISettings.StorageHelper Issue #47

Open
DevTKSS opened this issue Jan 6, 2025 · 0 comments
Labels
difficulty/tbd kind/bug Something isn't working tool/Hot Design™ triage/untriaged Indicates an issue requires triaging or verification.

Comments

@DevTKSS
Copy link

DevTKSS commented Jan 6, 2025

Current behavior

Entering HotDesign Mode with using DetailsListView is throwing an Unhandled Exception telling about its not able to load requested Types and showing strange Studio UI with disabling any device scaling for that app runtime

Console output:

The specified framework 'Microsoft.WindowsDesktop.App' is not present in the previously loaded runtime.
warn: Uno.UI.HotDesign.Client.Logic.Types.TypesDiscoveryService[0]
      Unable to load types for assembly CommunityToolkit.WinUI, Version=7.1.0.0, Culture=neutral, PublicKeyToken=4aff67a105548ee2: Unable to load one or more of the requested types.
      Could not load type 'CommunityToolkit.Common.Helpers.ISettingsStorageHelper`1' from assembly 'CommunityToolkit.Common, Version=8.2.0.0, Culture=neutral, PublicKeyToken=4aff67a105548ee2'.
      Could not load type 'CommunityToolkit.Common.Helpers.ISettingsStorageHelper`1' from assembly 'CommunityToolkit.Common, Version=8.2.0.0, Culture=neutral, PublicKeyToken=4aff67a105548ee2'.
fail: Uno.UI.Dispatching.NativeDispatcher[0]
      NativeDispatcher unhandled exception
      System.Reflection.ReflectionTypeLoadException: Unable to load one or more of the requested types.
      Could not load type 'CommunityToolkit.Common.Helpers.ISettingsStorageHelper`1' from assembly 'CommunityToolkit.Common, Version=8.2.0.0, Culture=neutral, PublicKeyToken=4aff67a105548ee2'.
      Could not load type 'CommunityToolkit.Common.Helpers.ISettingsStorageHelper`1' from assembly 'CommunityToolkit.Common, Version=8.2.0.0, Culture=neutral, PublicKeyToken=4aff67a105548ee2'.
         at System.Reflection.RuntimeModule.GetTypes(RuntimeModule module)
         at System.Reflection.RuntimeModule.GetTypes()
         at Uno.UI.HotDesign.Client.ToolboxItemProviders.AssemblyToolboxItemsProvider.GetToolboxItemsFromAssembly(Assembly assembly)
         at System.Linq.Enumerable.WhereSelectEnumerableIterator`2.MoveNext()
         at System.Linq.Enumerable.SelectManySingleSelectorIterator`2.MoveNext()
         at System.Collections.Generic.List`1.AddRange(IEnumerable`1 collection)
         at Uno.UI.HotDesign.Client.ToolboxItemProviders.AssemblyToolboxItemsProvider.GetToolboxItems()
         at Uno.UI.HotDesign.Client.ToolboxItemProviders.CompositeToolboxItemsProvider.GetToolboxItems()
         at Uno.UI.HotDesign.Client.Logic.ToolboxItemsLogic.get_ToolboxItems()
         at Uno.UI.HotDesign.Client.HotDesignClientMessageHandler.Uno.UI.HotDesign.IHotDesignMessageHandler.ProcessMessage(IHotDesignMessage message)
         at Uno.UI.HotDesign.MessageBroker.HandlerQueue.<>c__DisplayClass19_0.<<ProcessQueue>g__Callback|1>d.MoveNext()
      --- End of stack trace from previous location ---
         at System.Threading.Tasks.Task.<>c.<ThrowAsync>b__128_0(Object state)
         at Uno.UI.Dispatching.NativeDispatcherSynchronizationContext.<>c__DisplayClass3_0.<Post>b__0() in /__w/1/s/src/Uno.UI.Dispatching/Native/NativeDispatcherSynchronizationContext.cs:line 21
         at Uno.UI.Dispatching.NativeDispatcher.DispatchItems() in /__w/1/s/src/Uno.UI.Dispatching/Native/NativeDispatcher.cs:line 129
      System.TypeLoadException: Could not load type 'CommunityToolkit.Common.Helpers.ISettingsStorageHelper`1' from assembly 'CommunityToolkit.Common, Version=8.2.0.0, Culture=neutral, PublicKeyToken=4aff67a105548ee2'.
      System.TypeLoadException: Could not load type 'CommunityToolkit.Common.Helpers.ISettingsStorageHelper`1' from assembly 'CommunityToolkit.Common, Version=8.2.0.0, Culture=neutral, PublicKeyToken=4aff67a105548ee2'.

C:\Users\TKSSonja\Projects\UnoApp1\UnoApp1\bin\Debug\net8.0-desktop\UnoApp1.exe (Prozess "36816") wurde mit Code "0" (0x0) beendet.
Um die Konsole beim Beenden des Debuggens automatisch zu schließen, aktivieren Sie "Extras" > "Optionen" > "Debuggen" > "Konsole beim Beenden des Debuggings automatisch schließen".
Drücken Sie eine beliebige Taste, um dieses Fenster zu schließen.
Studio_ListDetailsView_Issue.mp4

Expected behavior

regular Behavior would be wanted without that issue

Which tool(s) are affected?

Hot Design™

How to reproduce it (as minimally and precisely as possible)

FeedView Code:

        <mvux:FeedView x:Name="LeftFeedView"
                       Grid.Column="0"
                        Grid.Row="1"
                        Source="{Binding GalleryImages}"
                        Margin="3"
                       Tag="This is a cool ListView fed from FeedView, isn't it?">

            <mvux:FeedView.ValueTemplate>
                <DataTemplate x:DataType="models:GalleryImageModel">
                    <ctklc:ListDetailsView ItemsSource="{Binding Data}"
                                           ListHeader="Candidates you can choose from"
                                           ItemTemplate="{ThemeResource CompactItemsTemplate}"
                                           DetailsTemplate="{ThemeResource DetailsTemplate}"
                                           HorizontalAlignment="Stretch"
                                           HorizontalContentAlignment="Stretch"
                                           VerticalContentAlignment="Stretch">

                    </ctklc:ListDetailsView>
                </DataTemplate>
            </mvux:FeedView.ValueTemplate>

DataTemplates in Generic.xaml


    <DataTemplate x:Key="CompactItemsTemplate" x:DataType="models:GalleryImageModel">
        
        <Grid Background="{ThemeResource SecondaryContainerBrush}"
              Padding="10" VerticalAlignment="Stretch">
           
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition Width="*"/>
                <ColumnDefinition Width="Auto"/>
            </Grid.ColumnDefinitions>
            <PersonPicture ProfilePicture="{Binding ImageLocation}"
                           Width="60"
                           Style="{StaticResource DefaultPersonPictureStyle}"
                           Grid.Column="0"/>

            <TextBlock Text="{Binding Title}"
                       Style="{ThemeResource TitleSmall}"
                       Margin="16,14,16,0"
                       Foreground="{ThemeResource OnSecondaryContainerBrush}"
                       VerticalAlignment="Stretch"
                       HorizontalAlignment="Left"
                       TextAlignment="Left"
                       Grid.Column="1"
                       Padding="5"
                       TextWrapping="WrapWholeWords"/>
            <AppBarToggleButton x:Name="FavoriteBtn"
                                Grid.Column="2">
                <AppBarToggleButton.Icon>
                    <FontIcon Glyph="&#xEB52;" Foreground="DarkRed"/>
                </AppBarToggleButton.Icon>
            </AppBarToggleButton>
        </Grid>
    </DataTemplate>

    <DataTemplate x:Key="DetailsTemplate" x:DataType="models:GalleryImageModel">
        <Grid HorizontalAlignment="Stretch"
              VerticalAlignment="Stretch"
              Background="{ThemeResource SurfaceBrush}"
              CornerRadius="10"
              BorderBrush="{ThemeResource OutlineBrush}"
              BorderThickness="2">
            
            <Grid.RowDefinitions>
                <RowDefinition Height="*" MaxHeight="400"/>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="2*"/>
            </Grid.RowDefinitions>
            
                <Image Source="{Binding ImageLocation}"
                        Grid.Row="0"
                        Stretch="Uniform"
                        VerticalAlignment="Stretch"
                        HorizontalAlignment="Center" />
                <TextBlock Text="{Binding Title}"
                       Grid.Row="1"
                       Style="{ThemeResource TitleLarge}"
                       Background="{ThemeResource SurfaceVariantBrush}"
                       Foreground="{ThemeResource SurfaceInverseBrush}"/>
        
            <TextBlock Grid.Row="2"
                       Text="{Binding Description}"
                       TextWrapping="WrapWholeWords"
                       Style="{ThemeResource BodyMedium}"
                       Foreground="{ThemeResource SurfaceInverseBrush}"/>
            
        </Grid>
    </DataTemplate>

Workaround

Not use WCT7 Controls with Studio, Add this control in the regular Controls if you are talented enough

Affected platforms

Desktop (Skia)

Uno.Sdk version

5.6.0-dev.198 & 5.5.56

IDE used

Visual Studio 2022

IDE version

17.12.3

Uno Platform Extension version

5.5.61.107

Relevant plugins

Uno.CommunityToolkit.WinUI.UI.Controls.Layout (7.1.204)
CommunityToolkit.WinUI.Converters (8.1.240916)

Anything else we need to know?

ViewState of ListDetailsView is not visible to be used from xaml, but from sourcecode, it should be

@DevTKSS DevTKSS added difficulty/tbd kind/bug Something isn't working triage/untriaged Indicates an issue requires triaging or verification. labels Jan 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
difficulty/tbd kind/bug Something isn't working tool/Hot Design™ triage/untriaged Indicates an issue requires triaging or verification.
Projects
None yet
Development

No branches or pull requests

1 participant