MenuItem with TextBox possible?
Posted: 14 Feb 2020, 15:00
I'm new to WPF xaml.
I want to design customized MenuItem, so I try with some snippets like this
(reference: https://stackoverflow.com/questions/154 ... ving-mouse)
I designs a ContextMenu.
It works in Blend project side, which appears like this way.

But in Unity editor, the ContextMenu with TextBox-MenuItem is also displayed correctly.
But when I click the TextBox trying to input something, it encounters exception.
So I want to ask if I'm doing something wrong?
Or this is not supported yet?
I am using NoesisGUI v2.2.4 now.
I want to design customized MenuItem, so I try with some snippets like this
(reference: https://stackoverflow.com/questions/154 ... ving-mouse)
I designs a ContextMenu.
Code: Select all
<ContextMenu>
...
<MenuItem>
<MenuItem.Header>
<Border>
<TextBox Width="50" Height="20"/>
</Border>
</MenuItem.Header>
</MenuItem>
</ContextMenu>

But in Unity editor, the ContextMenu with TextBox-MenuItem is also displayed correctly.
But when I click the TextBox trying to input something, it encounters exception.
Code: Select all
[noesis] Visual is not a descendant of the specified ancestor
UnityEngine.Debug:LogError(Object)
NoesisUnity:UnityLog(Int32, String) (at Assets/NoesisGUI/Plugins/NoesisUnity.cs:116)
Noesis.NoesisGUI_PINVOKE:Visual_TransformToAncestor(HandleRef, HandleRef)
Noesis.Visual:TransformToAncestor(Visual) (at Assets/NoesisGUI/Plugins/API/Proxies/Visual.cs:87)
IME:UpdateCursor() (at Assets/NoesisGUI/Plugins/NoesisUnity.cs:191)
IME:Open(UIElement) (at Assets/NoesisGUI/Plugins/NoesisUnity.cs:156)
NoesisUnity:SoftwareKeyboard(UIElement, Boolean) (at Assets/NoesisGUI/Plugins/NoesisUnity.cs:332)
Noesis.GUI:OnSoftwareKeyboard(IntPtr, Boolean) (at Assets/NoesisGUI/Plugins/API/Core/NoesisGUI.cs:267)
Noesis.View:Noesis_View_MouseButtonDown(HandleRef, Int32, Int32, Int32)
Noesis.View:MouseButtonDown(Int32, Int32, MouseButton) (at Assets/NoesisGUI/Plugins/API/Core/View.cs:126)
NoesisView:ProcessEvent(Event, Boolean, Boolean, Boolean) (at Assets/NoesisGUI/Plugins/NoesisView.cs:936)
NoesisView:OnGUI() (at Assets/NoesisGUI/Plugins/NoesisView.cs:1045)
Or this is not supported yet?
I am using NoesisGUI v2.2.4 now.