简体   繁体   English

WinRT - 值不在预期范围内

[英]WinRT - Value does not fall within the expected range

I have to make a MetroApp Frontend in C#. 我必须在C#中创建一个MetroApp前端。

I have an OverviewPage where i got a GridView with a Preview of the Detail Page. 我有一个OverviewPage,我得到了一个带有详细页面预览的GridView I discribed it more detailed and with screenshot in the following thread: WinRT XamlControl Preview Image 我在下面的主题中更详细地描述了它和截图: WinRT XamlControl预览图像

I get the Content-Panel which i display in the DetailPage from an external library. 我从外部库中获取我在DetailPage中显示的Content-Panel。

Because i want a Preview of the DetailPage in my OverviewItems i have to show the same Panel in my GridView Items . 因为我想在我的OverviewItems中预览DetailPage,我必须在我的GridView Items显示相同的Panel

When i click on an Item it navigates me to the DetailPage and i get the following error when i try to add the Panel to my DetailPage: Value does not fall within the expected range. 当我点击一个Item它导航我到DetailPage,当我尝试将Panel添加到我的DetailPage时,我得到以下错误:值不在预期的范围内。

I think this is because i got already a Panel with equal names in my VisualTree?! 我想这是因为我的VisualTree中已经有一个名字相同的Panel?! Is this assumption right? 这个假设是对的吗? The Panel contains a Canvas with some xaml elements and onclick-Event-triggers on it btw. Panel包含一个带有一些xaml元素的Canvas和ontlick-Event-triggers就可以了。

What can i do to fix this bug? 我该怎么做才能解决这个问题? I dont know how to continue.. :/ 我不知道如何继续......:/

If you need more information - just ask please. 如果您需要更多信息 - 请咨询。

You can't use the same instance of an element in multiple places in the app, so if an instance is already somewhere in the visual tree - you can't also add it elsewhere. 您不能在应用程序的多个位置使用相同的元素实例,因此如果实例已经位于可视树中的某个位置 - 您也无法将其添加到其他位置。 I don't think duplicate names are a problem unless they are in the same name scope and if they were you would probably fail at build time. 我不认为重复的名称是一个问题,除非它们在相同的名称范围内,如果它们是你可能会在构建时失败。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM