Gesture Fail while button click? #18563
-
Newbe question/bug(?) incoming Since WinSDK is out of order at the moment, i am targeting Desktop in visual studio 2022 terminal tells me: "The specified framework 'Microsoft.WindowsDesktop.App' is not present in the previously loaded runtime. How to reproduce that: Untill now I did only vb.net with winforms and never done anything async |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 5 replies
-
We are aware of this warning message (issue #7646), but it should not affect functionality of the app, does it have any adverse effect? |
Beta Was this translation helpful? Give feedback.
-
@MartinZikmund: I think I may have the reason for this behaviour on my application, but I am struggeling with how to do it right. Maybe some more experienced could help with the final solution for that... I let gpt check the code of both (MainPage, MainModel) and it came back with the answer, that this gesture fail situation will most likly result from the fact that I am calling the task to show the ContentDialog from a MenuFlyoutItem implemented along the winUI in the dropdown button. So the dropdownbutton will collapse after clicking on the item in its children while the result of the contentDialog Task is finished. I read the documentation pages but somehow I dont find the right way/syntax for it to solve. Template Button in the StackPanel: new Button() which called the async Task in the MainModel using the name Property there: public partial record MainModel
Okay, so since I would like to do something like this winui3gallery://item/ContentDialog mentioned in the WinUI Gallery to the ContentDialog, where it uses just a button to show a dialog and put in the result into the textblock right from the button (okay, my textblock is below, but should not really matter where it is) new Button() What I also added was the input parameters for the Dialog, to maybe make this more... flexible? I like to follow known patterns, which means: In WindowsForms there is the overloadable Method "DialogResult Messagebox.Show(Win32Window WindowOwner, String text, String title, [MessageBoxButton button = MessageBoxButton.OK], [MessageBoxIcon(Enum) icon = null], [button defaultButton = FirstButton])" which in my opinion is really nice because there is just one Method to call for showing this MessageBox and getting the Options to add the properties just there in the call. I would love to generate a template, service... please excuse, I just dont know the correct area for this task, I am open for correction to know this in the future! Okay, so since in the template uses a IState kind of... Property? which is filled from the TextBox, I had this Idea to do my result just other way around:
public async Task ShowDialogAsync(XamlRoot xamlRoot,
} So in my thought, this click would call the task to run with lambda and do not really need to watch that anymore, so should not any longer do this gesture fail in my opinion. new TextBlock() but sadly I seem to do something wrong because now, the compiler tells me the /unsave thing, other than before and still do not even show the dialog... maybe the gesture fail is happening because it opened the dialog (whereever) and wants me to answer it |
Beta Was this translation helpful? Give feedback.
We are aware of this warning message (issue #7646), but it should not affect functionality of the app, does it have any adverse effect?