Search found 53 matches

by BartekW
09 May 2021, 10:41
Forum: General Discussion
Replies: 1
Views: 23

UserControl binding to ContentControl's Content

Hey, I wanna bind my UserControl *uc to ContentControl's Content so I have declared my UserControl in class Ptr<UserControl> uc; Then I create in method new UserControl void TestMenuContent::OnTab2Focused(BaseComponent * param) { uc = MakePtr<Tab2Content>(); NS_UNUSED(param); } Here is my NsProp NsP...
by BartekW
07 May 2021, 12:13
Forum: General Discussion
Replies: 8
Views: 31

Re: Can't focus User Control using Focus()

Okey, finally Thanks sfernandez. You gave me a thoughts how to make it and I make Focus() in OnLoaded method currentControl = new Tab2Content(); currentControl->Loaded() += MakeDelegate(this, &paNVMTestScreen::OnLoaded); Finally it pass Focus 1. but Idk how to set focus on the specified element in x...
by BartekW
07 May 2021, 11:58
Forum: General Discussion
Replies: 8
Views: 31

Re: Can't focus User Control using Focus()

So, I checked
bool loaded = currentControl->IsLoaded();
and it returns false hmm
How Can I wait for it?
CoomandInvoke in Loaded trigger?
by BartekW
07 May 2021, 11:48
Forum: General Discussion
Replies: 8
Views: 31

Re: Can't focus User Control using Focus()

Yea with empty action without TargetName it seems do nothing but I made that <i:Interaction.Triggers> <i:EventTrigger EventName="Loaded"> <noesis:SetFocusAction TargetName="SubTab1"/> </i:EventTrigger> </i:Interaction.Triggers> I made that into Tab2Content.xaml And It works almost like I want, but I...
by BartekW
07 May 2021, 11:14
Forum: General Discussion
Replies: 8
Views: 31

Re: Can't focus User Control using Focus()

Actually I tryed ur version and its still the same. Should I execute this Focus() method in specified place? Becouse I call this in VM class, which dont inheritance from any UIElement. It inheritance from NoesisApp::NotifyPropertyChangedBase
by BartekW
07 May 2021, 10:42
Forum: General Discussion
Replies: 8
Views: 31

Re: Can't focus User Control using Focus()

UserControl class overrides Focusable property and set its default value to "False", so if you need to Focus() your user control then you should set Focusable="True" first. Yea, I did it before look: <UserControl x:Class="MyControls.UserControls.Tab2Content" xmlns="http://schemas.microsoft.com/winf...
by BartekW
07 May 2021, 09:58
Forum: General Discussion
Replies: 8
Views: 31

Can't focus User Control using Focus()

Hey, I have issue, I binded UserControl from C++ to ContentControl in WPF and after create new() UserControl I can't focus that using Focus(). Take a look currentControl = new Tab2Content(); bool focused = currentControl->Focus(); focused bool returns false and I don't know why. Note The new view is...
by BartekW
06 May 2021, 10:41
Forum: General Discussion
Replies: 13
Views: 73

Re: Keyboard Navigation - how to make a tree of focusable input?

You want to databind a ContentControl to the a property on the ViewModel. That property will change to whatever should be displayed. Then you define the UserControls as DataTemplates for these types. https://stackoverflow.com/questions/57372573/navigation-with-mvvm-template-wpf-application Yee I un...
by BartekW
05 May 2021, 14:43
Forum: General Discussion
Replies: 13
Views: 73

Re: Keyboard Navigation - how to make a tree of focusable input?

What if I would have 10 menus (whole menu with submenus), can I have 1 ViewModel for them or ViewModel per menu?
by BartekW
05 May 2021, 13:40
Forum: General Discussion
Replies: 13
Views: 73

Re: Keyboard Navigation - how to make a tree of focusable input?

Yes you want to do your navigation in a view model. THe button press should trigger a command. I know u helped me a lot but maybe if u wanna make quickly code, even pseudocode with comments how View Model works? Just rly simple. I work in C++. In Menu3D it works on enum but what if I will have 20 v...