When you are using the RadBusyIndicator control you always have to set its Content property. This will be the content on top of which you want to visualize the RadBusyIndicator control." in this article http://www.telerik.com/help/silverlight/radbusyindicator-getting-started.html I mocked up this quick demo to see if I could use it. WPF app loads a window. In the window is a frame which loads a page. On that page is a button that when clicked puts the thread to sleep for 3 seconds. In that button I get a handle to the parent window and set the IsBusy to true....but it never shows. I've tried numerous variations but I can't get it to work in my project or my mockup??
MainWindow:
<Window x:Class="LoadingTest.MainWindow" xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation" Title="MainWindow" Height="350" Width="525"> <Grid> <telerik:RadBusyIndicator x:Name="Thnk" IsBusy="false" telerik:StyleManager.Theme="Expression_Dark" > <Frame Name="frm_BigBro" Grid.Row="0" Source="Page1.xaml" SnapsToDevicePixels="True" /> </telerik:RadBusyIndicator> </Grid></Window>Main Page cs
public void StartThinking() { Thnk.IsBusy = true; } public void StopThinking() { Thnk.IsBusy = false; }
Page1 XAML
<Grid> <TextBlock Text="My Page" /> <Button x:Name="Button1" Click="Button1_Click" Width="80" Height="20" /></Grid>Page1 cs
private void Button1_Click(object sender, RoutedEventArgs e) { MainWindow wndow = new MainWindow(); wndow = Window.GetWindow(sender as DependencyObject) as MainWindow; wndow.StartThinking(); System.Threading.Thread.Sleep(3000); wndow.StopThinking(); }I'm sure it works so I must be doing something wrong?
TIA
JB
Hi we are using Telerik controls 2011 Q1.
We have an application that has a Docking control, and inside another control that has Docking control.
The parameter AllowUnsafeMode = "true" on both.
When we drag the inner Docking we got next exception:
Exception.Message:
"The specified Visual is not an ancestor of this Visual."
Exception.CallStack;
at System.Windows.Media.Visual.TrySimpleTransformToAncestor(Visual ancestor, Boolean inverse, GeneralTransform& generalTransform, Matrix& simpleTransform)
at System.Windows.Media.Visual.InternalTransformToAncestor(Visual ancestor, Boolean inverse)
at System.Windows.Media.Visual.TransformToAncestor(Visual ancestor)
at Telerik.Windows.Controls.RadDocking.GetElementPositionRelatedToPopup(FrameworkElement element) in c:\Builds\WPF_Scrum\Release_WPF\Sources\Development\Controls\Docking\Docking\RadDocking.cs:line 1868
at Telerik.Windows.Controls.RadDocking.MoveCompassToElement(FrameworkElement element) in c:\Builds\WPF_Scrum\Release_WPF\Sources\Development\Controls\Docking\Docking\RadDocking.cs:line 1883
at Telerik.Windows.Controls.RadDocking.ShowHideCompass(Point position, RadPaneGroup group, Boolean isCompassOverDH) in c:\Builds\WPF_Scrum\Release_WPF\Sources\Development\Controls\Docking\Docking\RadDocking.cs:line 1823
at Telerik.Windows.Controls.RadDocking.MoveDraggedElement(Point position, ToolWindow draggedWindow) in c:\Builds\WPF_Scrum\Release_WPF\Sources\Development\Controls\Docking\Docking\RadDocking.cs:line 1782
at Telerik.Windows.Controls.RadDocking.OnDragDelta(Point globalPosition, Object draggedElement) in c:\Builds\WPF_Scrum\Release_WPF\Sources\Development\Controls\Docking\Docking\RadDocking.cs:line 862
at Telerik.Windows.Controls.RadDocking.OnDragDelta(Object sender, DragInfoEventArgs e) in c:\Builds\WPF_Scrum\Release_WPF\Sources\Development\Controls\Docking\Docking\RadDocking.cs:line 1309
at Telerik.Windows.Controls.Docking.DragInfoEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget) in c:\Builds\WPF_Scrum\Release_WPF\Sources\Development\Controls\Docking\Docking\DragDrop\DragInfoEventArgs.cs:line 48
at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
at System.Windows.UIElement.RaiseEvent(RoutedEventArgs e)
at Telerik.Windows.Controls.Docking.FakePopup.<.ctor>b__0(Object s, RoutedEventArgs e) in c:\Builds\WPF_Scrum\Release_WPF\Sources\Development\Controls\Docking\Docking\Popup\FakePopup.cs:line 26
at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
at System.Windows.UIElement.RaiseEvent(RoutedEventArgs e)
at Telerik.Windows.Controls.Docking.DragDropHelper.DragDelta(UIElement target, UIElement dragRoot, MouseEventArgs e) in c:\Builds\WPF_Scrum\Release_WPF\Sources\Development\Controls\Docking\Docking\DragDrop\DragDropHelper.cs:line 55
at Telerik.Windows.Controls.Docking.DragDropHelper.DragDelta(UIElement target, MouseEventArgs e) in c:\Builds\WPF_Scrum\Release_WPF\Sources\Development\Controls\Docking\Docking\DragDrop\DragDropHelper.cs:line 50
at Telerik.Windows.Controls.Docking.ToolWindow.OnToolWindowMouseMove(Object sender, MouseEventArgs e) in c:\Builds\WPF_Scrum\Release_WPF\Sources\Development\Controls\Docking\Docking\ToolWindow.cs:line 712
at System.Windows.Input.MouseEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget)
at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
at System.Windows.UIElement.RaiseEvent(RoutedEventArgs args, Boolean trusted)
at System.Windows.Input.InputManager.ProcessStagingArea()
at System.Windows.Input.InputManager.ProcessInput(InputEventArgs input)
at System.Windows.Input.InputProviderSite.ReportInput(InputReport inputReport)
at System.Windows.Interop.HwndMouseInputProvider.ReportInput(IntPtr hwnd, InputMode mode, Int32 timestamp, RawMouseActions actions, Int32 x, Int32 y, Int32 wheel)
at System.Windows.Interop.HwndMouseInputProvider.FilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at System.Windows.Interop.HwndSource.InputFilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Boolean isSingleParameter)
at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler)
at System.Windows.Threading.Dispatcher.WrappedInvoke(Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler)
at System.Windows.Threading.Dispatcher.InvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Boolean isSingleParameter)
at System.Windows.Threading.Dispatcher.Invoke(DispatcherPriority priority, Delegate method, Object arg)
at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)
at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.Run(Form mainForm)
at xxxxxxxxx.Main(String[] args) in C:\xxxxxxxx\SplashForm.cs:line 155
There is fix for that?
<Window x:Class="MainWindow" xmlns:local="clr-namespace:WpfRadSliderTest" xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation" Title="MainWindow" Height="350" Width="525"> <Window.Resources> <local:IntegerToMonthConverter x:Key="intToMonthConv" /> </Window.Resources> <Grid> <telerik:RadSlider Margin="25" VerticalAlignment="Center" telerik:StyleManager.Theme="Windows7" Minimum="0" Maximum="5" TickFrequency="1" IsMouseWheelEnabled="True" IsSnapToTickEnabled="True" IsMoveToPointEnabled="True" TickPlacement="BottomRight"> <telerik:RadSlider.TickTemplate> <DataTemplate> <Grid Background="Purple" MinHeight="{Binding Path=ActualHeight, Mode=OneWay, RelativeSource={RelativeSource AncestorType=telerik:RadTickBar}}"> <StackPanel> <Ellipse Width="5" Height="5" Fill="Black" /> <Label Content="{Binding Mode=OneWay, Converter={StaticResource intToMonthConv}}" Foreground="Yellow" /> </StackPanel> </Grid> </DataTemplate> </telerik:RadSlider.TickTemplate> <!--<telerik:RadSlider.TickBarStyle> <Style TargetType="telerik:RadTickBar"> <Setter Property="MinWidth" Value="50" /> </Style> </telerik:RadSlider.TickBarStyle>--> </telerik:RadSlider> </Grid></Window>Public Class IntegerToMonthConverter Implements IValueConverter Private Shared ReadOnly Months As String() = {"January", "February", "March", "April", "May", "June"} Public Function Convert(value As Object, targetType As System.Type, parameter As Object, culture As System.Globalization.CultureInfo) As Object Implements System.Windows.Data.IValueConverter.Convert Dim index = CInt(value) If index < 0 OrElse index >= Months.Length Then Return String.Empty Return Months(index) End Function Public Function ConvertBack(value As Object, targetType As System.Type, parameter As Object, culture As System.Globalization.CultureInfo) As Object Implements System.Windows.Data.IValueConverter.ConvertBack Throw New NotSupportedException End FunctionEnd Class<Window x:Class="TelerikRadFilter.MainWindow" xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation" Title="MainWindow" Height="auto" Width="auto"> <Grid> <Grid.RowDefinitions> <RowDefinition /> <RowDefinition /> </Grid.RowDefinitions> <StackPanel> <Button Content="YTest" HorizontalAlignment="Center" Width="100"/> <telerik:RadDataFilter Name="radDataFilter" Background="Aqua" Grid.Row="0" MinHeight="193" MaxHeight="250" Width="700" Source="{Binding Employees}" Margin="1"/> </StackPanel> <telerik:RadGridView Name="radGridView" Grid.Row="1" MinHeight="193" MaxHeight="250" Width="700" ItemsSource="{Binding Employees}" ColumnWidth="*" IsFilteringAllowed="False" CanUserFreezeColumns="False" RowIndicatorVisibility="Collapsed" AutoGenerateColumns="False" Margin="1"> <telerik:RadGridView.Columns> <telerik:GridViewDataColumn DataMemberBinding="{Binding FirstName}" Header="First Name"/> <telerik:GridViewDataColumn DataMemberBinding="{Binding LastName}" Header="Last Name"/> <telerik:GridViewDataColumn DataMemberBinding="{Binding DateOfBirth}" DataFormatString="{}{0:d}" Header="Date Of Birth"/> <telerik:GridViewDataColumn DataMemberBinding="{Binding Address}" /> <telerik:GridViewDataColumn DataMemberBinding="{Binding City}" /> <telerik:GridViewDataColumn DataMemberBinding="{Binding State}"/> <telerik:GridViewDataColumn DataMemberBinding="{Binding Salary}" DataFormatString="{}{0:C2}" /> </telerik:RadGridView.Columns> </telerik:RadGridView> </Grid></Window>