Telerik Telerik
The Telerik Blogs

RadWindow for Silverlight

Wednesday, July 09, 2008 by XAML Team | Comments 6

             Preview of RadWindow for Silverlight RadControls CTP2

My first post for the Telerik blog community is already here. After I have been part of the Silverlight team for a while, I learned that there are two ways you can get noticed here. Either you blog about some of the most interesting and top-notch stuff happening around, or you post some funny stuff on the internal newsgroups of the company. OK, I hope this post won’t make it for the newsgroups.

 So lets get to the point, as our CTP2 release is underway, I am pleased to introduce one of the new controls included in the pack - RadWindow. I just cannot imagine a proper Silverlight application which doesn’t have the necessity for a Window.

That is why we have decided to include our RadWindow control even in the CTP2 scheduled for July, 14. Thus, we will have enought time to get some of your highly appreciated feedback prior to our next major release due end of July.

RadWindow exposes most of the best-known methods and properties of a WPF window, which have already become natural to manage and use. You will have the ability to set up properties like start up location, states, styles, resize modes, title, top, left and topmost. You can also really on the common events for a window like opened, loaded, closing, closed that expose event arguments such as Dialog and Prompt results. Even if you are not into creating your own windows, you won’t mind using just the line-long static methods Alert, Prompt and Confirm. For the sake of simplicity, you can use these methods to quickly get feedback from the user without bothering yourself with design and implementing specific logic behind the window. In Silverlight, there is no way of stopping the current UI thread like in WPF, thus you cannot get results from a window synchronously. That is why, the static Alert, Prompt and Confirm methods contain overloads with EventHandler parameters for handling the opened and closed events. Moreover, for those of you who don’t like the default theme of these windows, there is also a theme parameter allowing you to set your own appearance.

The minimize button of web windows has always amazed me, the usability you get from it has nothing to do with the WPF or Win Forms window we are all used to. It just minimizes the window without arranging it anywhere. That is why, we have included a property PreserveSizeAndLocation that stores the last size and position a window took in its normal and minimized states, so that when you hit the minimize or restore button it goes to its last “minimized or normal size and position” and you don’t have to move it every time from the center of the screen.

The design and the rich visual states you get with the default RadWindow theme guarantees experience simply a level ahead and that isn’t everything at all. RadWindow can be defined in XAML as any other Silverlight control, thus it can be easily edited or skinned using Microsoft Expression Blend.

 

6 Comments

  • Scott 10 Jul
    The Window control for Silverlight looks great! Can't wait to see it in action!
  • Ian Blackburn 10 Jul
    Great work! looking forward to it
  • Michael 10 Jul
    This will be great to have in our toolbox!
  • greatt workk.. thanks
  • Dan 15 Sep
    Hi,

    I'm having some trouble using RadControls_for_WPF_2009_2_0813_TRIAL. I have used in a project RadWindow for WPF. "Sometimes" when I close a window the InvalidOperationException is thrown. I'm hoping to find help here, because for the moment I'm using the trial version of the controls, trying to demonstrate that this is a fine acquisition. Here is part of my stack trace:

    Startup URI: ....xbap
    Application Identity: file:///....xbap

    System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.InvalidOperationException: Sequence contains no elements
       at System.Linq.Enumerable.Max(IEnumerable`1 source)
       at Telerik.Windows.Controls.RadWindowPopup.WindowPopupAdornerFactory.WindowPopupAdornerImpl.BringToFront()
       at Telerik.Windows.Controls.RadWindowManager.BringToFront(RadWindow window)
       at Telerik.Windows.Controls.RadWindow.<BringToFront>b__3()
       --- End of inner exception stack trace ---
       at System.RuntimeMethodHandle._InvokeMethodFast(Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)
       at System.RuntimeMethodHandle.InvokeMethodFast(Object target, Object[] arguments, Signature sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)
       at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks)
       at System.Delegate.DynamicInvokeImpl(Object[] args)
       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.DispatcherOperation.InvokeImpl()
       at System.Windows.Threading.DispatcherOperation.InvokeInSecurityContext(Object state)
       at System.Threading.ExecutionContext.runTryCode(Object userData)
       at System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, Object userData)
       at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
       at System.Windows.Threading.DispatcherOperation.Invoke()
       at System.Windows.Threading.Dispatcher.ProcessQueue()
       at System.Windows.Threading.Dispatcher.WndProcHook(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 MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg)
       at System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)
       at System.Windows.Threading.Dispatcher.PushFrame(DispatcherFrame frame)
       at System.Windows.Threading.Dispatcher.Run()
       at System.Windows.Application.RunDispatcher(Object ignore)
       at System.Windows.Application.StartDispatcherInBrowser(Object unused)
       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.DispatcherOperation.InvokeImpl()
       at System.Windows.Threading.DispatcherOperation.InvokeInSecurityContext(Object state)
       at System.Threading.ExecutionContext.runTryCode(Object userData)
       at System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, Object userData)
       at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
       at System.Windows.Threading.DispatcherOperation.Invoke()
       at System.Windows.Threading.Dispatcher.ProcessQueue()
       at System.Windows.Threading.Dispatcher.WndProcHook(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)

    -----------------------

    Thanks !!
  • Mesut ÇAKIR 26 Apr
    Good worked.Thank you.

Add comment

  1. Formatting options
       
     
     
     
     
       
  2. (optional, emails won't be shown on public pages)
  3. (optional)