GraphPresenter doesn't work in a UWP app inside a Uno project
还没有人认领这个 Issue。
评估
调研方向
从共享项目的 MainPage.xaml 开始,在使用 Microsoft.Toolkit.Graph.Controls 7.0.0-preview2 的新 Uno 解决方案中的 UWP 应用内重现该问题。将其与独立 UWP 的结果进行比较,并追踪 GraphPresenter 为空的原因;当 GraphPresenter 按预期行为显示邮件列表时,即视为完成。
由索引模型根据 Issue 内容生成。
描述
Describe the bug
The GraphPresenter control works fine when it's executed in a standalone UWP app, but it doesn't render when the same UWP app is part of an Uno-based solution.
- Is this bug a regression in the toolkit? If so, what toolkit version did you last see it work:
Steps to Reproduce
Steps to reproduce the behavior:
- Create a new Uno solution
- Add the Microsoft.Toolkit.Graph.Controls NuGet to the UWP project
- Add the following XAML to the MainPage.xaml file in the shared project:
<Page
x:Class="App13.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:App13"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d"
xmlns:toolkit="using:Microsoft.Toolkit.Graph.Controls"
xmlns:Interactivity="using:Microsoft.Xaml.Interactivity"
xmlns:providers="using:Microsoft.Toolkit.Graph.Providers"
xmlns:graph="using:Microsoft.Graph"
Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
<Interactivity:Interaction.Behaviors>
<providers:MockProviderBehavior />
</Interactivity:Interaction.Behaviors>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<toolkit:LoginButton Grid.Row="0" />
<toolkit:GraphPresenter
Grid.Row="1"
RequestBuilder="{x:Bind providers:ProviderManager.Instance.GlobalProvider.Graph.Me.Messages, Mode=OneWay}"
ResponseType="graph:Message"
IsCollection="True">
<toolkit:GraphPresenter.ContentTemplate>
<DataTemplate>
<ScrollViewer HorizontalScrollMode="Disabled" VerticalScrollBarVisibility="Auto">
<ItemsControl ItemsSource="{Binding}">
<ItemsControl.ItemTemplate>
<DataTemplate x:DataType="graph:Message">
<StackPanel>
<toolkit:PersonView PersonQuery="{x:Bind Sender.EmailAddress.Address}" ShowName="True" Margin="-4"/>
<TextBlock Text="{x:Bind Subject}" Style="{StaticResource BaseTextBlockStyle}" Padding="0"/>
</StackPanel>
</DataTemplate>
</ItemsControl.ItemTemplate>
<ItemsControl.ItemContainerStyle>
<Style TargetType="ContentPresenter">
<Setter Property="Margin" Value="0,8,0,8"/>
</Style>
</ItemsControl.ItemContainerStyle>
</ItemsControl>
</ScrollViewer>
</DataTemplate>
</toolkit:GraphPresenter.ContentTemplate>
</toolkit:GraphPresenter>
</Grid>
</Page>
- Run the UWP app
Expected behavior
A list of mail, presented through the GraphPresenter control, is displayed in the main page. The control, instead, is empty.
The same exact XAML code in a standalone UWP app (not part of an Uno solution) works fine.
Screenshots
This is the output of the UWP app included in the Uno solution:

This is the output, instead, of a standalone UWP app:

Environment
NuGet Package(s): Microsoft.Toolkit.Graph.Controls
Package Version(s): 7.0.0-preview2
Windows 10 Build Number:
- [ ] Fall Creators Update (16299)
- [ ] April 2018 Update (17134)
- [ ] October 2018 Update (17763)
- [ ] May 2019 Update (18362)
- [x] October 2020 Update (19042)
- [ ] Insider Build (build number: )
App min and target version:
- [ ] Fall Creators Update (16299)
- [ ] April 2018 Update (17134)
- [ ] October 2018 Update (17763)
- [ ] May 2019 Update (18362)
- [x] October 2020 Update (19042)
- [ ] Insider Build (xxxxx)
Device form factor:
- [x] Desktop
- [ ] Xbox
- [ ] Surface Hub
- [ ] IoT
Visual Studio
- [ ] 2017 (version: )
- [x] 2019 (version: 16.7.7 )
- [ ] 2019 Preview (version: )
Additional context
Add any other context about the problem here.
- 主要语言
- C#
- 星标
- 156
- 派生
- 37
- PR 合并指标
- 30 天内没有已合并 PR
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 没有贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
CommunityToolkit/Graph-Controls 的其他 Issue
-
bug :bug:
难度 4/5 3-5 天 新手友好度 25/100
CommunityToolkit/Graph-Controls#211 · 3 条评论 ·
-
CommunityToolkit.Authentication.Msal use Microsoft Graph V4 but if you install V5,you cannot release未关闭bug :bug: needs attention :wave: needs triage :mag:
难度 4/5 3-5 天 新手友好度 25/100
CommunityToolkit/Graph-Controls#208 · 20 条评论 ·
-
enhancement :sparkles:
难度 2/5 1-3 小时 新手友好度 35/100
-
Area: Providers
难度 2/5 1-3 小时 新手友好度 55/100
CommunityToolkit/Graph-Controls#195 · 1 条评论 ·
-
Area: Providers bug :bug:
难度 4/5 3-5 天 新手友好度 35/100
CommunityToolkit/Graph-Controls#189 · 3 条评论 ·
查看 CommunityToolkit/Graph-Controls 的全部 Issue
相似的 Issue
-
area: core bug help wanted ready
难度 2/5 1-3 小时 新手友好度 62/100
维护者通常 1 天内回复
-
area: remote bug
难度 2/5 1-3 小时 新手友好度 68/100
维护者通常 1 天内回复
-
📅 Sprint 4 Module-Tools Setup Submit:None 🦔 Size Tiny
难度 2/5 1-3 小时 新手友好度 70/100
CodeYourFuture/Module-Tools#712 ·
-
A: Mapping P3: Standard T: New Feature
难度 2/5 1-3 小时 新手友好度 68/100
space-wizards/space-station-14#46878 · 2 条评论 ·
维护者通常 1 天内回复
-
难度 2/5 半天 新手友好度 60/100
CommunityToolkit/Windows#896 · 2 条评论 ·