Closed AndyMahub closed 1 year ago
FYI:
But app crashes after add a new TabViewItem. I have no any idea why.
STOP! I have found the problem, and i'm so proud, sorry :-D
Okay, what have helped me:
`
</TabView.TabItems>`
That's is. After this, i can add my "own" TabItems without crash the app.
I say it again, i don't know, is this a bug, or my fault, but this here works for me :-)
Best regards Andy
@MikeHillberg should this have failed at compile time rather than runtime and is a bug? Otherwise Andy figured out the problem and isn't blocked, but transferring to WinUI to see if there's anything additional to be done at compile-time here!
@karenbtlai who saw something similar to this recently as well
@beervoley the tabview expert
@AndyMahub did you have any TabViewItems in XAML markup inside TabView by default before your fix?
I can't say for sure why this happens, but you can't have different "classes" of TabViewItem present at the same time inside the TabView. If you have any TabViewItem <TabViewItem>....</TabViewItem>
inside your TabView in XAML markup and then you try to add your "own" TabViewItem - the TabView will crash :)
As you correctly did, included local:TabViewItem
to point to your own TabViewItem instead of controls:TabViewItem :)
@beervoley No, in the XAML was nothing between <TabView>
-Tabs. Only Attributes like Background and x:Name.
After a long search, i have add a empty "own Tab"(in the XAML) and it works.
You can reproduce this. Create a own (empty) class with inherits TabViewItem, create a empty XAML without TabViewItem-Tags and in Code-Behind you add a Tab from the inherited class. App crashes. But if you add a empty Tab in XAML and remove this after app starting in code behind, it works. For me.
Any ideas for a workaround if your TabViewItem-derived class can't be instantiated in XAML (i.e. no default constructor)?
This issue is stale because it has been open 180 days with no activity. Remove stale label or comment or this will be closed in 5 days.
Hi,
i have created only a empty MyTabViewItem-Class with inherits to TabViewItem like this:
Nothing more. Then i have in MainWindow-Class this method:
Okay, i start my app and after the OpenNewTab-Method i receive this message:
I don't know, is this my fault, or is this a bug? I would like to expand the TabViewItem with a few own functions.
Thanks for your time and help Andy
Version Info
NuGet package version: Microsoft.ProjectReunion 0.5.0