Telerik Forums
UI for WPF Forum
2 answers
109 views
Can you make extension for new ARM verison of Visual Studio 2022?
Viliana
Telerik team
 answered on 29 Feb 2024
2 answers
19 views

Hello everyone,

 

on my WPF application I have to use a WizardPages component to make a configuration. These configuration (and the relative pages) may changes based on a combobox item selectable on the first WizardPage (a page in common for all configurations).

My question is.... It's possible to add WizardPages dynamically based on the selection on the combobox of first page?

 

Thank you

 

 

 

 

Marco
Top achievements
Rank 1
Iron
 answered on 02 Feb 2024
1 answer
17 views

Hi,

I have this code and i do not know how to bind to a view model command when i check a checkbox or when i write in a column.

<UserControl x:Class="WISN.Windows.Survey.FacilityStaffControl"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:vm="clr-namespace:WISN.Windows.Survey.ViewModels"
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
             mc:Ignorable="d" 
             d:DesignHeight="450" d:DesignWidth="800">

    <telerik:RadTreeListView x:Name="stufftreeListView" AutoGenerateColumns="False"
                                 AutoExpandItems="True" GroupRenderMode="Flat" CanUserDeleteRows="False"
                                 ItemsSource="{Binding AllStaffByType,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged }">
            <telerik:RadTreeListView.ChildTableDefinitions>
                <telerik:TreeListViewTableDefinition ItemsSource="{Binding StaffCategories,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"></telerik:TreeListViewTableDefinition>
            </telerik:RadTreeListView.ChildTableDefinitions>

            <telerik:RadTreeListView.Columns>
                <telerik:GridViewCheckBoxColumn DataMemberBinding="{Binding IsSelected}" AutoSelectOnEdit="True" EditTriggers="CellClick">
                    <telerik:EventToCommandBehavior.EventBindings>
                        <telerik:EventBinding Command="{Binding CustomCommandCommand}" EventName="MouseLeftButtonDown" />
                    </telerik:EventToCommandBehavior.EventBindings>
                </telerik:GridViewCheckBoxColumn>
                <telerik:GridViewDataColumn IsReadOnly="True" DataMemberBinding="{Binding Name}" Header="Stuff"></telerik:GridViewDataColumn>
                <telerik:GridViewDataColumn DataMemberBinding="{Binding AnnualSalary}" Header="Annual Salary"></telerik:GridViewDataColumn>
            </telerik:RadTreeListView.Columns>
        </telerik:RadTreeListView>
</UserControl>

Thanks

 

Dimitar
Telerik team
 answered on 17 Jan 2024
1 answer
25 views

To simplify things, consider the following MainWindow class inheriting fromSystem.Windows.Window:

using System;
using System.Diagnostics;
using System.Windows;
using System.Windows.Input;

namespace WpfApp1
{
    public partial class MainWindow : Window
    {
        public MainWindow()
        {
            InitializeComponent();
            StateChanged += MainWindow_StateChanged;
            MouseUp += MainWindow_MouseUp;
        }

        private void MainWindow_StateChanged(object sender, EventArgs e)
        {
            if (WindowState == WindowState.Maximized)
            {
                Debug.WriteLine("Window Maximized");
            }
        }

        private void MainWindow_MouseUp(object sender, MouseButtonEventArgs e)
        {
            Debug.WriteLine("Window MouseUp");
        }
    }
}

When this window is in normal state if I double click its title bar then it is maximized and a Window.MouseUp event is raised, which results in the following output in VS Output pane:

Window Maximized
Window MouseUp
Now replace this Window with Telerik.Windows.Controls.Docking.ToolWindow.cs (v 2022.3.1005.60) and assume we double click the title bar of a ToolWindow and make it maximized. My question is: Are these events raised always in this particular order; that is first maximized and then mouse up in ToolWindow? Can you guarantee this order with all conditions? (Heavy UI load, multiple threads etc.) Guaranteeing this order is crucial for me since I depend on this order for my control in the ToolWindow.
Martin Ivanov
Telerik team
 answered on 25 Dec 2023
0 answers
50 views
i have three xaml pages for my wpf panel. One is the main page which in the xaml has a <content x:Name=“page2”> defined and the page 2 is where my button is. This button has a mouse down event when pressed should show page 3. However i cant achieve that now with my implementation. How can i be able to do that? I am using xaml and code behind not mvvm
Yohannes
Top achievements
Rank 1
 asked on 14 Jul 2023
0 answers
49 views

Hi, i'm having a rough fight with WPF and its Binding system. I just wanna bind a property of an instance called HPP, this property is pressure and this object exist in MainViewModel, so in MainWindow.xaml a have this:


<componentes:SetComponent x:Name="HPP_Trip_Route" Grid.Row="1" Grid.Column="1" VerticalAlignment="Top" Title="TRIP" VariableValue="{Binding HPPRoute.Pressure}" Unity="PSI" Loaded="SetComponent_Loaded" FSizeTitle="24" FSizeVariable="36" FSizeUnity="14"/>
In SetComponent:
<TextBlock x:Name="ValueSetComponent" Grid.Row="1" Text="{Binding VariableValue, RelativeSource={RelativeSource AncestorType=UserControl}}" FontSize="{Binding FSizeVariable}" HorizontalAlignment="Right" VerticalAlignment="Bottom" Foreground="#FFFFFF" Margin="0, 5, 0, 5 "/>
Dar clic y arrastrar para mover
In MainWindow.xaml.cs:

public partial class MainWindow : Window, INotifyPropertyChanged
    {
        private readonly Variables GV = Variables.GetInstancia();
        private MainViewModel _mainViewModel;
        public MainViewModel MainViewModel
        {
            get { return _mainViewModel; }
            set
            {
                _mainViewModel = value;
                OnPropertyChanged();
            }
        }

        public MainWindow()
        {
            InitializeComponent();
            GV.MainViewModel.StartAssign(GV);
            MainViewModel = GV.MainViewModel;
            GV.MainViewModel.MainWindow = this;
            DataContext = MainViewModel;
     
        }
        public event PropertyChangedEventHandler PropertyChanged;

        protected virtual void OnPropertyChanged([CallerMemberName] string propertyName = null)
        {
            PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
        }

I tried with RelativeSource without success. If i create a variable in MainViewModel it works. Any help?

Fenix
Top achievements
Rank 1
 asked on 12 Jul 2023
1 answer
33 views

When I use the WindowsFormsHost in Radbusyindicator,

then I change the window size, and the UI shows very slowly and seems wrong.

The content of the WindowsFormsHost is just a Label.

I am not sure if there are some details in this case.

 

<telerik:RadBusyIndicator IsBusy="False">
        <Grid>
            <Grid.RowDefinitions>
                <RowDefinition Height="*"/>
                <RowDefinition Height="30"/>
            </Grid.RowDefinitions>
            <WindowsFormsHost>
                <cc:UserControl1/>
            </WindowsFormsHost>
        </Grid>
    </telerik:RadBusyIndicator>

 

Martin Ivanov
Telerik team
 answered on 21 Jun 2023
1 answer
36 views

Hi,

i try to save and load minimized ToolWindows. This works, but the original size gets lost.

Reproduce: Minimize ToolWindow, Save, Load, Restore -> wrong size

I atteched a simple sample where you can push the buttons from 1 to 4 to reproduce it. Pressing button 1 and 4 back and forth works as expected.
In the produced XML i see, that FloatingWidth and FloatingHeight is reset to some "strange" values (160 and 28) after minimize.
When i restore the Window after Load it gets a size of 1440x879

I also dont know how i can sneak in this process to "correct" the values or save some custom/attached ones ...

regards marco

Stenly
Telerik team
 answered on 09 Mar 2023
0 answers
72 views

I was reading this article here and it skips the process of how to add a Telerik RadWindow?  

There doesn't actually seem to be an option to add a Telerik WPF RadWindow, only the default Microsoft WPF window.

Documentation just says "Declare" ... so I'm assuming we're supposed to modify a Microsoft template for the XAML?

This is VS 2022 17.5 using Telerik UI WPF 2023.1.117.

Rob.

Rob
Top achievements
Rank 2
Iron
Iron
 asked on 02 Mar 2023
1 answer
51 views
Does an implict theme apply to a System.Windows.Window? I'm setting a dark variant to my theme and the System.Windows.Window is all white.
Martin Ivanov
Telerik team
 answered on 13 Jan 2023
Narrow your results
Selected tags
Tags
+? more
Top users last month
horváth
Top achievements
Rank 2
Iron
Iron
Steve
Top achievements
Rank 2
Iron
Erkki
Top achievements
Rank 1
Iron
Mark
Top achievements
Rank 2
Iron
Iron
Veteran
Jakub
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
horváth
Top achievements
Rank 2
Iron
Iron
Steve
Top achievements
Rank 2
Iron
Erkki
Top achievements
Rank 1
Iron
Mark
Top achievements
Rank 2
Iron
Iron
Veteran
Jakub
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?