Get handle for a userControl #18663
Replies: 1 comment 3 replies
-
I am coming from Winforms and vb.net before recently started learning uno plattform development, so in my opinion the "Handle" type of IntPtr in vb.net as far as I know in uno application should be the xamlRoot if I understood that correct so far :) E.g.:
and it would be happy (okay, title, buttons and icon are optional, but you know what I mean by that) So in WinForms it would expect the MyParentWindowHandle as Win32Window. In Uno App using a MessageBox (or is it called MessageDialog? nevermind) is outdated and only present for compatiblity as far as I read below Dialogs docs, you would do the same as mentioned above with writing a async void/Task in the MainPage (ViewModel did not work for me last days, opened a issue already) thats doing this:
Normally I would also tell you to use a XamlRootProvider (no standard Class but should really be), but if you dont use mvvm I would not recommend because in my opinion you should not need it when you can call this.XamlRoot and "this" is some control that do have a xamlRoot. you can also choose some control thats known (write the Name in a c# markup with Name(out var SomeKnownName)) and that should also work. Hope this answers your question? |
Beta Was this translation helpful? Give feedback.
-
I am trying to bind the ui output of a process (freerdp parent-window parm) to the windowId for a userControl.
In winforms I would just get the Handle for the Form or Control I wanted to use as the surface.
Not sure how to do that in Uno though.
Any help would be a appreciated
Beta Was this translation helpful? Give feedback.
All reactions