This is a migrated thread and some comments may be shown as answers.
RadPane visibility
13 Answers 24 Views
This is a migrated thread and some comments may be shown as answers.
Anton
Top achievements
Rank 1
Anton asked on 07 Dec 2020, 07:39 AM

Hello.

 

In out project (MVVM, Microsoft prism) we use RadPaneGroup with RadPane. I need understand when user see RadPane. For this i use visibily and isSelected properties:

 

<telerik:RadPaneGroup>
                    <telerik:RadPane Header="{telerik:LocalizableResource Key=Neo_DailyIntroductionPlanFact}"
                                     Name="ActivityDailyIntroductionFactTab" 
                                     telerik:RadDocking.SerializationTag="DailyIntroductionFact"
                                     IsSelected="{Binding ActivityFactDataTabIsSelected, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
                                     CanUserClose="False" 
                                     IsPinned="False" 
                                     Visibility="{Binding ActivityFactDataTabVisibility, Mode=OneWay, UpdateSourceTrigger=PropertyChanged}">

                       
                            <ContentControl HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch" 
                                            regions:RegionManager.RegionName="{x:Static helpers:LocalRegionsNames.ActivityDailyIntroductionFactRegion}" />
                        </telerik:RadBusyIndicator>
                    </telerik:RadPane>
                </telerik:RadPaneGroup>

 

When user view is closing, property IsSelected becomes equal 'true', even if it was equal before 'false'...why this happen?

Teleric 2018.1.116.45

13 Answers, 1 is accepted

Sort by
0
Anton
Top achievements
Rank 1
answered on 07 Dec 2020, 07:41 AM
Maybe you can explain, how i can understand that user see now RadPane?
0
Vladimir Stoyanov
Telerik team
answered on 09 Dec 2020, 12:39 PM

Hello Anton,

Thank you for the shared sample code. 

The IsSelected property is changed before the RadPane is closed, since the selection happens when the pane is focused. This takes place when the user clicks the close button. In other words, the pane is selected before it is closed, since there was a click over it. 

As for checking whether the pane is open or closed, you can use the IsHidden property of the RadPane. 

On a side note, I have moved this thread to RadDocking section of the UI for WPF forum.

I hope you find this information helpful.

Regards,
Vladimir Stoyanov
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

0
Anton
Top achievements
Rank 1
answered on 11 Dec 2020, 08:22 AM
[quote]Vladimir Stoyanov said:

As for checking whether the pane is open or closed, you can use the IsHidden property of the RadPane. 

On a side note, I have moved this thread to RadDocking section of the UI for WPF forum.

I hope you find this information helpful. 

[/quote]

Hello. don't work correctly...radpan is visible, IsHidden is false, radpan not visible, IsHidden is false...what wrong?
0
Anton
Top achievements
Rank 1
answered on 11 Dec 2020, 10:18 AM

[quote]Anton said:

Hello. don't work correctly...radpan is visible, IsHidden is false, radpan not visible, IsHidden is false...what wrong?[/quote]

radpan is open, IsHidden is false, radpan is closed, IsHidden is false

0
Anton
Top achievements
Rank 1
answered on 14 Dec 2020, 11:01 AM
Also, i want understand, how i can get radPane from radDocing by radPane name?
0
Vladimir Stoyanov
Telerik team
answered on 15 Dec 2020, 11:55 AM

Hello Anton,

Please, find a sample project attached demonstrating how you can bind the IsHidden property of a RadPane to a property in the viewmodel. Note, that in order to restore a pane after it is hidden, you need to make sure to explicitly set the DataContext of the RadPane. 

I have also demonstrated how you can access a RadPane instance by iterating the Panes collection of the RadDocking.

I hope you find this helpful.

Regards,
Vladimir Stoyanov
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

0
Anton
Top achievements
Rank 1
answered on 17 Dec 2020, 04:59 AM
[quote]Vladimir Stoyanov said:

Hello Anton,

Please, find a sample project attached demonstrating how you can bind the IsHidden property of a RadPane to a property in the viewmodel. Note, that in order to restore a pane after it is hidden, you need to make sure to explicitly set the DataContext of the RadPane. 

I have also demonstrated how you can access a RadPane instance by iterating the Panes collection of the RadDocking.

I hope you find this helpful.

Regards,
Vladimir Stoyanov

[/quote]

Hello.

I get error "The calling thread cannot access this object because another thread owns this object." when try get pane by name in Task.Run(), how i can doit in this case?

 

In your example get error, that which can be seen in attached (Reference error).

 

In my project, i have this xaml markup

<telerik:RadDocking x:Name="Docking" 
                            Grid.Column="1"
                            Background="{telerik:Windows8Resource ResourceKey=AccentBrush}"
                            HasDocumentHost="False"
                            BorderThickness="0" 
                            PaneStateChange="Docking_OnPaneStateChange">
            <telerik:RadSplitContainer>
                
                <telerik:RadPaneGroup>
                    <telerik:RadPane Header="{telerik:LocalizableResource Key=Neo_DailyIntroductionPlanFact}"
                                     Name="ActivityDailyIntroductionFactTab" 
                                     telerik:RadDocking.SerializationTag="DailyIntroductionFact"                                     
                                     CanUserClose="False" 
                                     IsPinned="False"                                      
                                     IsHidden="{Binding ActivityFactDataTabIsHidden, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}">

                       
                        <telerik:RadBusyIndicator BusyContent="{Binding BusyVM.ReportInfo.Message}">
                            <telerik:RadBusyIndicator.IsBusy>
                                <MultiBinding Converter="{StaticResource BooleanAndConverter}">
                                    <Binding Path="BusyVM.IsBusy"/>
                                    <Binding RelativeSource="{RelativeSource Mode=FindAncestor, AncestorType={x:Type telerik:RadPane}}" Path="IsFloating"/>
                                </MultiBinding>
                            </telerik:RadBusyIndicator.IsBusy>

                            <ContentControl HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch" 
                                            regions:RegionManager.RegionName="{x:Static helpers:LocalRegionsNames.ActivityDailyIntroductionFactRegion}" />

                        </telerik:RadBusyIndicator>
                    </telerik:RadPane>
                </telerik:RadPaneGroup>

            </telerik:RadSplitContainer>
        </telerik:RadDocking>

 

and RadPane IsHidden don't set value in binding property, only get...

0
Anton
Top achievements
Rank 1
answered on 17 Dec 2020, 05:47 AM
[quote]Anton said:  

 

In your example get error, that which can be seen in attached (Reference error).

[/quote]
0
Vladimir Stoyanov
Telerik team
answered on 17 Dec 2020, 03:45 PM

Hello Anton,

Thank you for the updates. 

When using Task.Run, the action is executed on a different thread. The RadDocking (and any other WPF element) can only be accessed on the UI thread on which it was created. With this in mind, you can use the Dispatcher's BeginInvoke method in order to execute the action. Here is some sample code:

Task.Run(() =>
            {
                Dispatcher.BeginInvoke(new Action(() =>
                {
                    var pane = this.radDocking.Panes.FirstOrDefault(p => p.Name == "firstPane");
                }));

            });

As for the demonstrated error, I am not able to replicate it on my end. I am attaching back the sample project along with the UI for WPF dlls that I used. You can also check out a video of the IsHidden behavior here. Note, that I have explicitly set the DataContext of the RadPane, which is necessary, since its Content is placed in a separate visual tree when the pane is pinned or floated. 

If you need any further assistance, or the behavior observed on your end is different, I would ask you to modify the sample project in order to demonstrate your scenario and send it back in a new support ticket (since project files cannot be attached to forum posts). This will allow us to investigate the scenario and better assist you.

Regards,
Vladimir Stoyanov
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

0
Anton
Top achievements
Rank 1
answered on 18 Dec 2020, 03:47 AM
[quote]Vladimir Stoyanov said:

Hello Anton,

Thank you for the updates. 

 

[quote]Vladimir Stoyanov said:

As for the demonstrated error, I am not able to replicate it on my end. I am attaching back the sample project along with the UI for WPF dlls that I used. You can also check out a video of the IsHidden behavior here. Note, that I have explicitly set the DataContext of the RadPane, which is necessary, since its Content is placed in a separate visual tree when the pane is pinned or floated. 

If you need any further assistance, or the behavior observed on your end is different, I would ask you to modify the sample project in order to demonstrate your scenario and send it back in a new support ticket (since project files cannot be attached to forum posts). This will allow us to investigate the scenario and better assist you.

[/quote]

Thank you, is works now. But we did not understand each other, i mean that pan is show or hide as seen on attached file. I need understand when user see pan (pinned or unpinned), which property i can use?

0
Martin Ivanov
Telerik team
answered on 22 Dec 2020, 11:33 AM

Hello Anton,

To check if a pane is pinned or unpinned, you can use its IsPinned property. Read more about this in the help documentation.

Regards,
Martin Ivanov
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

0
Anton
Top achievements
Rank 1
answered on 22 Dec 2020, 12:47 PM
[quote]Martin Ivanov said:

Hello Anton,

To check if a pane is pinned or unpinned, you can use its IsPinned property. Read more about this in the help documentation.

 

[/quote]

But we did not understand each other, i mean that user see pan on screen whatever pinned or unpinned (this is never mind), which property i can use? IsOpen property exists? Can i read them? 

По русски это звучит так, "хочу знать когда панель отображается на экране. Закреплена она или нет это не важно, важно что она отображается на экране, раскрыта, а не свернута". 

0
Dinko
Telerik team
answered on 25 Dec 2020, 09:03 AM

Hi Anton,

Thank you for the provided details.

I think I understand what you meant here. You want to know when the pane is flyout. For example, when the pane is pinned, and you click/mouse over the pin header, a pane's preview will appear. This comes from the FlyoutBehavior of the control. What you can try here is to create a custom class that implements the IFlyoutBehavior interface. In the OnMouseEnter method, you can get the current hover pane from the second parameter. Let me know if I am in the right direction. 

Regards,
Dinko
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content, including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Asked by
Anton
Top achievements
Rank 1
Answers by
Anton
Top achievements
Rank 1
Vladimir Stoyanov
Telerik team
Martin Ivanov
Telerik team
Dinko
Telerik team
Share this question
or