Search Results

Search found 49 results on 2 pages for 'viewbox'.

Page 1/2 | 1 2  | Next Page >

  • How to center and scale Silverlight applications using ViewBox control

    - by Jacek Ciereszko
    There are many ways to make your application scalable in Web Browser window and align it in the center. Usually we use two Grid controls to align and panel control (like Canvas) to scale our apps. Not the best solution <UserControl … >     <Grid x:Name="LayoutRoot" Background="White">         <Grid HorizontalAlignment="Center" VerticalAlignment="Center">             <Canvas x:Name="scalePanel" VerticalAlignment="Top" HorizontalAlignment="Center">                 …             </Canvas>         </Grid>     </Grid> </UserControl>               The example above usually works but there are better ways. How? Use ViewBox. ViewBox control contains scale mechanisms with some stretching options. So ViewBox together with Grid control is all what we need to align and scale our applications. Good solution <UserControl … >     <Grid x:Name="LayoutRoot" Background="White">         <Viewbox>             ...         </Viewbox>     </Grid> </UserControl> How to find ViewBox control For those applications created in Silverlight 4, ViewBox is available in plug-in. For applications created in Silverlight 3 you can find it in Microsoft Silverlight Toolkit. Demo Let’s create a simple application that will contain: Button, TextBlock and red Rectangle. It will also have some Margin settings. This application won’t be in the center of window and it will not scale. <UserControl … >     <Grid x:Name="LayoutRoot">         <Grid Margin="100, 50, 100, 20">                 <StackPanel Orientation="Horizontal">                     <Button Width="100" Height="100" Content="test"/>                     <TextBlock Text="Button" Width="100" Height="100" />                     <Rectangle Width="100" Height="100" Fill="Red"/>                 </StackPanel>         </Grid> </Grid> </UserControl>   Run demo: RUN But If we use ViewBox control, we will got centered and always scaled application.    <Grid x:Name="LayoutRoot">         <Viewbox>             <Grid Margin="100, 50, 100, 20">                     <StackPanel Orientation="Horizontal">                         <Button Width="100" Height="100" Content="test"/>                         <TextBlock Text="bottom" Width="100" Height="100" />                         <Rectangle Width="100" Height="100" Fill="Red"/>                     </StackPanel>             </Grid>         </Viewbox>     </Grid> Link to application: RUN (try to resize application’s window) Link to source code: SilverlightCenterApplication.zip References ViewBox for Silverlight 3 http://silverlight.codeplex.com/    Polish version: http://jacekciereszko.pl/2010/05/jak-wysrodkowac-i-skalowac-aplikacje.html Jacek Ciereszko

    Read the article

  • WPF: Viewbox and TranslatePoint

    - by Samir Sabri
    Hello, I have a Viewbox with a Canvas Child, I have the Stretch property of Viewbox to Fill, I have changed the width and height of the Viewbox, I need to get the location of children in Canvas with respect to Viewbox parent I tried : Point p = viewboxInstance.TranslatePoint(new Point(Canvas.GetLeft(child), Canvas.GetTop(child)), viewboxInstanceParent); it gets wrong coordinates! Is there a solution or work around ? Thanks

    Read the article

  • WPF: Change the style of a ViewBox depending upon the amount of data

    - by Brett Rigby
    Hi there, I have a WPF app that has a ViewBox to display the items in my collection, diplaying a 2-column grid for my results. What I'd like to do is, depending on the number of items in my collection, change the number of columns. E.g if there are < 10 items in the list, then show them in just 1 column; If there are 10 items in my list, then show them in 2 columns; If there are 20 items in my list, then show 3 columns. Here's what I have at present: <Viewbox> <ItemsControl ItemsSource="{Binding myCollection}" Style="{DynamicResource myStyle}" /> </Viewbox> Here's what myStyle currently defines: <Style x:Key="myStyle" TargetType="{x:Type ItemsControl}"> <Setter Property=ItemsControl.ItemsPanel"> <Setter.Value> <ItemsPanelTemplate> <UniformGrid Columns="2" /> </ItemsPanelTemplate> </Setter.Value> </Setter> </Style> How can I make this code work to the above requirement? Thanks.

    Read the article

  • Rotating Viewbox contents smoothly

    - by user204562
    I'm looking to teach myself better methods of doing things in WPF that I would normally do manually. In this case, I have a ViewBox with an image in it. I also have a button that uses a DoubleAnimation to rotate the image 90 to the right. This animation works fine, but obviously because it's square as it turns, the image does a "best fit" to the ViewBox which makes the rotation look quite bad, as it gets larger and smaller as its longest edge shrinks or grows to fit to that particular rotation angle. I am looking for any advice on the best way to handle this using appropriate WPF methods. Obviously I could do all the calculations manually, but I would be more interested in finding a way to use the controls and methods built into the .NET architecture. Thanks for your help.

    Read the article

  • SVG - From Window coordinates to ViewBox coordinates

    - by user353072
    Hi, Basically I have an svg "SecondSVG" into an svg "FirstSVG" into an svg "MainSVG".Every svg has its own ViewBox. This page can be loaded anywhere on the screen by another page. So basically how can i find the screen x for viewBox for"SecondSVG" knowing that this svg can be loaded basically anywhere based on the calling page? event.clientX gives myself the x coordinate for the screen. If I don't know the coordinate for ViewBox of "SecondSVG" then how can I find out the x coordinate inside the ViewBox of "SecondSVG"? I am using Firefox 3.6.3 and I do have an event object from which I can extract clientX, clientY and other coordinates that are relative to the screen. However what I need are the coordinates inside the ViewBox.

    Read the article

  • Binding a Viewbox to a Canvas

    - by Bjarne
    I'm trying to bind a Viewbox to Canvas that is created dynamically like so: <ListBox.ItemTemplate> <DataTemplate> <DockPanel> <Viewbox> <ContentPresenter Content="{Binding Canvas}"/> </Viewbox> </DockPanel> </DataTemplate> </ListBox.ItemTemplate> This works fine as long as the Canvas doesn't have any children, but as soon at the Canvas has children it's not shown. What am I missing here?

    Read the article

  • Conditional XAML

    - by Nicholas
    For easy of development I'm using a ViewBox to wrap all content inside a Window. This is because my development machine has a smaller screen than the deployment machine so using a ViewBox allows for better realisation of proportion. Obviously there is no reason for it to be there on Release versions of the code. Is there an easy method to conditionally include/exclude that 'wrapping' ViewBox in XAML? E.g. <Window> <Viewbox> <UserControl /*Content*/> </Viewbox> </Window>

    Read the article

  • Twitter Bootstrap Navbar blocking svg viewBox

    - by user1167650
    I have a navbar fixed to the bottom and I have page that has a title and a giant svg (created by d3.js). I would like the svg to take up the entire screen (whatever is left over), but it always seems to have some part appear behind the bottom nav bar. I've tried: 1) using viewBox to auto-resize, setting the parent div and the svg to be block elements 2) adding padding-bottom to the body element But the svg still appears behind the navbar on wide screen monitors.

    Read the article

  • SVG Scaling Text to fit container

    - by Tom
    This is likely a very simple question, but how do I get text in SVG to stretch to fit its container? I don't care if it looks ugly from being stretched too long or high, but it needs to fits its container and be as big as possible. Thanks

    Read the article

  • DesignTime data not showing in Blend when bound against CollectionViewSource

    - by bitbonk
    I have datatemplate for a viewmodel where an itemscontrol is bound again a CollectionViewSource (to enable sorting in xaml). <DataTemplate x:Key="equipmentDataTemplate"> <Viewbox> <Viewbox.Resources> <CollectionViewSource x:Key="viewSource" Source="{Binding Modules}"> <CollectionViewSource.SortDescriptions> <scm:SortDescription PropertyName="ID" Direction="Ascending"/> </CollectionViewSource.SortDescriptions> </CollectionViewSource> </Viewbox.Resources> <ItemsControl ItemsSource="{Binding Source={StaticResource viewSource}}" Height="{DynamicResource equipmentHeight}" ItemTemplate="{StaticResource moduleDataTemplate}"> <ItemsControl.ItemsPanel> <ItemsPanelTemplate> <StackPanel Orientation="Horizontal" /> </ItemsPanelTemplate> </ItemsControl.ItemsPanel> </ItemsControl> </Viewbox> </DataTemplate> I have also setup the UserControl where all of this is defined to provide designtime data d:DataContext="{x:Static vm:DesignTimeHelper.Equipment}"> This is basically a static property that gives me an EquipmentViewModel that has a list of ModuleViewModels (Equipment.Modules). Now as long as I bind to the CollectionViewSource the designtime data does not show up in blend 3. When I bind to the ViewModel collection directly <ItemsControl ItemsSource="{Binding Modules}" I can see the designtime data. Any idea what I could do?

    Read the article

  • Is there any way to programitically change a Data/ItemTemplate in Silverlight?

    - by Kris Erickson
    So I have a Listbox, which is using an ItemTemplate to display an image. I want to be able to change the size of the displayed image in the ItemTemplate. Through databinding I can change the Width, but the only way I can see how to do this is to add a Property (Say, ImageSize) to the class I am binding to and then change every item in the colleciton to have a new ImageSize. Is there no way to access the property of an item in that Datatemplate? E.g. <navigation:Page.Resources> <DataTemplate x:Key="ListBoxItemTemplate"> <Viewbox Height="100" Width="100"> <Image Source="{Binding Image}"/> </Viewbox> </DataTemplate> </navigation:Page.Resources> <Grid> <ListBox ItemTemplate="{StaticResource ListBoxItemTemplate}" ItemSource="{Binding Collection}"/> </Grid> Is there anyway to set the Width and Height of the viewbox without binding a property to every element in the collection?

    Read the article

  • Storyboard apply to all labels

    - by ThitoO
    Hi everyone ! I whant to apply a little storyboard to a collection of labels in my window. My storyboard is like that : <Storyboard x:Key="Storyboard1" AutoReverse="True" RepeatBehavior="Forever"> <ColorAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="label" Storyboard.TargetProperty="(Label.Foreground).(SolidColorBrush.Color)"> <SplineColorKeyFrame KeyTime="00:00:00.1000000" Value="#FFFFFF"/> </ColorAnimationUsingKeyFrames> </Storyboard> I have a window composed of that : <Grid Background="#FF000000"> <Viewbox HorizontalAlignment="Center" VerticalAlignment="Center" Stretch="Uniform"> <UniformGrid x:Name="grid" Background="#FF000000" /> </Viewbox> </Grid> When I want to start my storyboard I do that : Storyboard.SetTarget( _stb, myLabel ); _stb.Begin(); where _std is my storyboard loaded by the window's resources. The animation works fine, but on all labels (not only the one I want). I tried to switch SetTarget by SetTargetName but labels are created into my window by the constructor and names can not be founded when I try "SetTargetName". Do you have any ideas ? Thanks :) ------------ Edit : We asked me to be more descriptive -------------------------------------------------------------------- Label are not created directly in the xaml, they are created by the constructor of the window : public SpellerWindow(IKeyboard keyboard, int colomnNumber, SolidColorBrush background, SolidColorBrush foreground ) { InitializeComponent(); grid.Columns = colomnNumber; int i = 0; foreach( IKey key in keyboard.Zones.Default.Keys ) { Label lb = new Label(); lb.Foreground = foreground; lb.Name = "label"+(i++).ToString(); lb.Content = key.ActualKeys[keyboard.CurrentMode].UpLabel; lb.HorizontalAlignment = HorizontalAlignment.Center; lb.VerticalAlignment = VerticalAlignment.Center; Viewbox box = new Viewbox(); box.Stretch = Stretch.Fill; box.Child = lb; box.Tag = key; grid.Children.Add( box ); } } Animations are started by an event handler : void Highlighter_StartAnimation( object sender, HiEventArgs e ) { Storyboard stb; if( !_anims.TryGetValue( e.Step.Animation.Name, out stb ) ) { stb = (Storyboard)_window.FindResource( e.Step.Animation.Name ); _anims.Add( e.Step.Animation.Name, stb ); } DoAnimations( _zones[e.Step.Zone], stb ); } Finally, animations are started by DoAnimations : void DoAnimations( List<Label> labels, Storyboard stb ) { foreach( Label lb in labels ) { Storyboard.SetTarget( stb, lb ); stb.Begin(); } } I want to highlight a collection of labels, but all labels are flashing. I don't know why, but I try to create a label into the Xaml directly, and set a Storyboard.TargetName (bound to the name of the label) in the Xaml of the storyboard. And it's working ... Now you know everything. Thanks for you help :)

    Read the article

  • Java .split() Method To Split XML Parameters

    - by Buzz Lightyear
    I have this line from an XML document: <?xml version="1.0" encoding="UTF-8"?> <svg xmlns:xlink="http://www.w3.org/1999/xlink" xmlns="http://www.w3.org/2000/svg" contentScriptType="text/ecmascript" width="1024" zoomAndPan="magnify" contentStyleType="text/css" viewBox="0 0 1024 768" height="768" preserveAspectRatio="xMidYMid meet" version="1.0"> I want to be able to split it up, using the split method. For example i want to save each parameter into a String array. So i'd like: contentScriptType="text/ecmascript" width="1024" zoomAndPan="magnify" contentStyleType="text/css" viewBox="0 0 1024 768" height="768" etc etc to be saved into a string array, is there anyway to do this using the split method, or can anybody suggest an easier, more efficient way to do this?

    Read the article

  • WPF Dispatcher {"The calling thread cannot access this object because a different thread owns it."}

    - by user359446
    first I need to say that I´m noob with WPF and C#. Application: Create Mandelbrot Image (GUI) My disptacher works perfektly this this case: private void progressBarRefresh(){ while ((con.Progress) < 99) { progressBar1.Dispatcher.Invoke(DispatcherPriority.Send, new Action(delegate { progressBar1.Value = con.Progress; } )); } } I get the Message (Title) when tring to do this with the below code: bmp = BitmapSource.Create(width, height, 96, 96, pf, null, rawImage, stride); this.Dispatcher.Invoke(DispatcherPriority.Send, new Action(delegate { img.Source = bmp; ViewBox.Child = img; //vllt am schluss } )); I will try to explain how my program works. I created a new Thread (because GUI dont response) for the calculation of the pixels and the colors. In this Thread(Mehtod) I´m using the Dispatcher to Refresh my Image in the ViewBox after the calculations are ready. When I´m dont put the calculation in a seperate Thread then I can refresh or build my Image.

    Read the article

  • <Tabcontrol and Canvas

    - by prajor
    Hello, I have following situation <stackpanel > <ViewBox height=25/ > <tabcontrol> <tabitem> <Canvas /> </tabitem> </tabcontrol> </stackpanel> Q1. I want stackpanel to fill the screen, tabcontrol to fill the remain portion after viewbox. How do I do that ? How do I avoid the tabcontrol shrinking based on the size of tab items. Q2. I want the canvas restricted to the tabitem size. Currently I put anything in the canvas and scorll it goes beyond the tab item. Any idea how to control this.

    Read the article

  • C# Dispatcher {"The calling thread cannot access this object because a different thread owns it."}

    - by user359446
    Hi, first I need to say that I´m noob with WPF and C#. Application: Create Mandelbrot Image (GUI) My disptacher works perfektly this this case: private void progressBarRefresh(){ while ((con.Progress) < 99) { progressBar1.Dispatcher.Invoke(DispatcherPriority.Send, new Action(delegate { progressBar1.Value = con.Progress; } )); } } I get the Message (Title) when tring to do this with the below code: bmp = BitmapSource.Create(width, height, 96, 96, pf, null, rawImage, stride); this.Dispatcher.Invoke(DispatcherPriority.Send, new Action(delegate { img.Source = bmp; ViewBox.Child = img; //vllt am schluss } )); I will try to explain how my program works. I created a new Thread (because GUI dont response) for the calculation of the pixels and the colors. In this Thread(Mehtod) I´m using the Dispatcher to Refresh my Image in the ViewBox after the calculations are ready. When I´m dont put the calculation in a seperate Thread then I can refresh or build my Image. PS: Sry for my bad english

    Read the article

  • Silverlight Cream for May 02, 2010 -- #854

    - by Dave Campbell
    In this Issue: Michael Washington, Jason Young(-2-, -3-), Phil Middlemiss, Jeremy Likness, Victor Gaudioso, Kunal Chowdhury, Antoni Dol, and Jacek Ciereszko(-2-). Shoutout: Victor Gaudioso has aggregated All of My Silverlight Video Tutorials in One Place (revised again 05.02.10) From SilverlightCream.com: Unit Testing A Silverlight 'Simplified MVVM' Modal Popup Michael Washington's latest 'Simplified MVVM' post is published at The Code Project and is on Unit Testing with MVVM. Input Localization in Silverlight without IValueConverter Jason Young sent me some links to posts I've not seen... this first one is on localization by using the Language property of the Root Visual. MVVM – The Model - Part 1 – INotifyPropertyChanged Jason Young's next archive post is the first of a series on MVVM and Silverlight 4 ... implementing a simple ViewModel base class. Silverlight, WCF, and ASP.Net Configuration Gotchas Jason Young worked at tracking down the answers to some forum questions and in the process has produced a post of 'gotchas' with using WCF in Silverlight. A Chrome and Glass Theme - Part 5 Phil Middlemiss has part 5 of his Chrome and Glass Theme tutorial up ... in this one, he's looking at the Progress Bar and Slider. Download the files and play along. Silverlight Out of Browser (OOB) Versions, Images, and Isolated Storage Jeremy Likness has a post up responding to his 3 major questions about OOB apps, and he has to code up for the sample too. New Silverlight Video Tutorial: How to Make a Slide In/Out Navigation Bar – All in Blend Victor Gaudioso's latest video tutorial is on building a Behavior for a Slide in/out Navigation bar... kinda like the menu sliders on my GlyphMap Utility... only easier! Command Binding in Silverlight 4 (Step-by-Step) Kunal Chowdhury has another post up at DotNetFunda, and this time he's talking about Command Binding in Silverlight 4 with an eye toward MVVM usage. The Silverlight PageCurl implementation Antoni Dol has a post up about doing a Page Curl effect in Silverlight. He has a manual up on the effect and full application code. How to center and scale Silverlight applications using ViewBox control Jacek Ciereszko has a couple posts up about centering and scaling your app with the ViewBox control. This first one is a code solution. Source is available, as is a Polish version. Silverlight Center And Scale Behavior Jacek Ciereszko's 2nd post, he provides a Behavior that handles the scaling and centering of the previous post. Stay in the 'Light! Twitter SilverlightNews | Twitter WynApse | WynApse.com | Tagged Posts | SilverlightCream Join me @ SilverlightCream | Phoenix Silverlight User Group Technorati Tags: Silverlight    Silverlight 3    Silverlight 4    Windows Phone MIX10

    Read the article

  • Silverlight 4 Training Kit

    - by ScottGu
    We recently released a new free Silverlight 4 Training Kit that walks you through building business applications with Silverlight 4.  You can browse the training kit online or alternatively download an entire offline version of the training kit.  The training material is structured on teaching how to use the new Silverlight 4 features to build an end to end business application. The training kit includes 8 modules, 25 videos, and several hands on labs. Below is a breakdown and links to all of the content. [In addition to blogging, I am also now using Twitter for quick updates and to share links. Follow me at: twitter.com/scottgu] Module 1: Introduction Click here to watch this module. In this video John Papa and Ian Griffiths discuss the key areas that the Building Business Applications with Silverlight 4 course focuses on. This module is the overview of the course and covers many key scenarios that are faced when building business applications, and how Silverlight can help address them. Module 2: WCF RIA Services Click here to explore this module. In this lab, you will create a web site for managing conferences that will be the basis for the other labs in this course. Don’t worry if you don’t complete a particular lab in the series – all lab manual instructions are accompanied by completed solutions, so you can either build your own solution from start to finish, or dive straight in at any point using the solutions provided as a starting point. In this lab you will learn how to set up WCF RIA Services, create bindings to the domain context, filter using the domain data source, and create domain service queries. Online Link Download Source Download Lab Document Videos Module 2.1 - WCF RIA Services Ian Griffiths sets up the Entity Framework and WCF RIA Services for the sample Event Manager application for the course. He covers how to set up the services, how the Domain Services work and the role that the DomainContext plays in the sample application. He also reviews the metadata classes and integrating the navigation framework. Module 2.2 – Using WCF RIA Services to Edit Entities Ian Griffiths discusses how he adds the ability to edit and create individual entities with the features built into WCF RIA Services into the sample Event Manager application. He covers data binding fundamentals, IQueryable, LINQ, the DomainDataSource, navigation to a single entity using the navigation framework, and how to use the Visual Studio designer to do much of the work . Module 2.3 – Showing Master/Details Records Using WCF RIA Services Ian Griffiths reviews how to display master/detail records for the sample Event Manager application using WCF RIA Services. He covers how to use the Include attribute to indicate which elements to serialize back to the client. Ian also demonstrates how to use the Data Sources window in the designer to add and bind controls to specific data elements. He wraps up by showing how to create custom services to the Domain Services. Module 3 – Authentication, Validation, MVVM, Commands, Implicit Styles and RichTextBox Click here to visit this module. This lab demonstrates how to build a login screen, integrate ASP.NET authentication, and perform validation on data elements. Model-View-ViewModel (MVVM) is introduced and used in this lab as a pattern to help separate the UI and business logic. You will also learn how to use implicit styling and the new RichTextBox control. Online Link Download Source Download Lab Document Videos Module 3.1 – Authentication Ian Griffiths covers how to integrate a login screen and authentication into the sample Event Manager application. Ian shows how to use the ASP.NET authentication and integrate it into WCF RIA Services and the Silverlight presentation layer. Module 3.2 – MVVM Ian Griffiths covers how to Model-View-ViewModel (MVVM) patterns into the sample Event Manager application. He discusses why MVVM exists, what separated presentation means, and why it is important. He shows how to connect the View to the ViewModel, why data binding is important in this symbiosis, and how everything fits together in the overall application. Module 3.3 –Validation Ian Griffiths discusses how validation of user input can be integrated into the sample Event Manager application. He demonstrates how to use the DataAnnotations, the INotifyDataErrorInfo interface, binding markup extensions, and WCF RIA Services in concert to achieve great validation in the sample application. He discusses how this technique allows for property level validation, entity level validation, and asynchronous server side validation. Module 3.4 – Implicit Styles Ian Griffiths discusses how why implicit styles are important and how they can be integrated into the sample Event Manager application. He shows how implicit styles defined in a resource dictionary can be applied to all elements of a particular kind throughout the application. Module 3.5 – RichTextBox Ian Griffiths discusses how the new RichTextBox control and it can be integrated into the sample Event Manager application. He demonstrates how the RichTextBox can provide editing for the event information and how it can display the rich text for selection and copying. Module 4 – User Profiles, Drop Targets, Webcam and Clipboard Click here to visit this module. This lab builds new features into the sample application to take the user's photo. It teaches you how to use the webcam to capture an image, use Silverlight as a drop target, and take advantage of programmatic access to the clipboard. Link Download Source Download Lab Document Videos Module 4.1 – Webcam Ian Griffiths demonstrates how the webcam adds value to the sample Event Manager application by capturing an image of the attendee. He discusses the VideoCaptureDevice, the CaptureDviceConfiguration, and the CaptureSource classes and how they allow audio and video to be captured so you can grab an image from the capture device and save it. Module 4.2 - Drag and Drop in Silverlight Ian Griffiths demonstrates how to capture and handle the Drop in the sample Event Manager application so the user can drag a photo from a file and drop it into the application. Ian reviews the AllowDrop property, the Drop event, how to access the file that can be dropped, and the other drag related events. He also reviews how to make this work across browsers and the challenges for this. Module 5 – Schedule Planner and Right Mouse Click Click here to visit this module. This lab builds on the application to allow grouping in the DataGrid and implement right mouse click features to add context menu support. Link Download Source Download Lab Document Videos Module 5.1 – Grouping and Binding Ian Griffiths demonstrates how to use the grouping features for data binding in the DataGrid and how it applies to the sample Event Manager application. He reviews the role of the CollectionViewSource in grouping, customizing the templates for headers, and how to work with grouping with ItemsControls. Module 5.2 – Layout Visual States Ian Griffiths demonstrates how to use the Fluid UI animation support for visual states in the ListBox control DataGrid and how it applies to the sample Event Manager application. He reviews the 3 visual states of BeforeLoaded, AfterLoaded, and BeforeUnloaded. Module 5.3 – Right Mouse Click Ian Griffiths demonstrates how to add support for handling the right mouse button click event to display a context menu for the Event Manager application. He demonstrates how to handle the event, show a custom context menu control, and integrate it into the scheduling portion of the application. Module 6 – Printing the Schedule Click here to visit this module. This lab teaches how to use the new printing features in Silverlight 4. The lab walks through the PrintDocument class and the ViewBox control, while showing how to print multiple pages of content using them. Link Download Source Download Lab Document Videos Module 6.1 – Printing and the Viewbox Ian Griffiths demonstrates how to add the ability to print the schedule to the sample Event Manager application. He walks through the importance of the PrintDocument class and its members. He also shows how to handle printing the visual tree and how the ViewBox control can help. Module 6.2 – Multi Page Printing Ian Griffiths expands on his printing discussion by showing how to handle printing multiple pages of content for the sample Event Manager application. He shows how to paginate the content and points out various tips to keep in mind when determining the printable area. Module 7 – Running the Event Dashboard Out of Browser Click here to visit this module. This lab builds a dashboard for the sample application while explaining the fundamentals of the out of browser features, how to handle authentication, displaying notifications (toasts), and how to use native integration to use COM Interop with Silverlight. Link Download Source Download Lab Document Videos Module 7.1 – Out of Browser Ian Griffiths discusses the role of an Out of Browser application for administrators to manage the events and users in the sample Event Manager application. He discusses several reasons why out of browser applications may better suit your needs including custom chrome, toasts, window placement, cross domain access, and file access. He demonstrates the basic technique to take your application and make it work out of browser using the tools. Module 7.2 – NotificationWindow (Toasts) for Elevated Trust Out of Browser Applications Ian Griffiths discusses the how toasts can be used in the sample Event Manager application to show information that may require the user's attention. Ian covers how to create a toast using the NotificationWindow, security implications, and how to make the toast appear as needed. Module 7.3 – Out of Browser Window Placement Ian Griffiths discusses the how to manage the window positioning when building an out of browser application, handling the windows state, and controlling and handling activation of the window. Module 7.4 – Out of Browser Elevated Trust Application Overview Ian Griffiths discusses the implications of creating trusted out of browser application for the Event Manager sample application. He reviews why you might want to use elevated trust, what features is opens to you, and how to take advantage of them. Topics Ian covers include the dynamic keyword in C# 4, the AutomationFactory class, the API to check if you are in a trusted application, and communicating with Excel. Module 8 – Advanced Out of Browser and MEF Click here to visit this module. This hands-on lab walks through the creation of a trusted out of browser application and the new functionality that comes with that. You will learn to use COM Automation, handle the window closing event, set custom window chrome, digitally sign your Silverlight out of browser trusted application, create a silent install option, and take advantage of MEF. Link Download Source Download Lab Document Videos Module 8.1 – Custom Window Chrome for Elevated Trust Out of Browser Applications Ian Griffiths discusses how to replace the standard operating system window chrome with customized chrome for an elevated trusted out of browser application. He covers how it is important to handle close, resize, minimize, and maximize events. Ian mentions that the tooling was not ready when he shot this video, but the good news is that the tooling now supports setting the custom chrome directly from the property page for the Silverlight application. Module 8.2 – Window Closing Event for Out of Browser Applications Ian Griffiths discusses the WindowClosing event and how to handle and optionally cancel the event. Module 8.3 – Silent Install of Out of Browser Applications Ian Griffiths discusses how to use the SLLauncher executable to install an out of browser application. He discusses the optional command line switches that can be set including how the emulate switch can help you emulate the install process. Ian also shows how to setup a shortcut for the application and tell the application where it should look for future updates online. Module 8.4 – Digitally Signing Out of Browser Application Ian Griffiths discusses how and why to digitally sign an out of browser application using the signtool program. He covers what trusted certificates are, the implications of signing (or not signing), and the effect on the user experience. Module 8.5 – The Value of MEF with Silverlight Ian Griffiths discusses what MEF is, how your application can benefit from it, and the fundamental features it puts at your disposal. He covers the 3 step import, export and compose process as well as how to dynamically import XAP files using MEF. Summary As you can probably tell from the long list above – this series contains a ton of great content, and hopefully provides a nice end-to-end walkthrough that helps explain how to take advantage of Silverlight 4 (and all its new features).  Hope this helps, Scott

    Read the article

  • WPF MenuItem IsChecked Binding not working

    - by Kaya
    Anyone know why the menu item binding does not work ? <ToggleButton Name="toggleButton" Checked="checkBoxPublish_Checked" > <ToggleButton.Resources> <converters:BooleanToHiddenVisibility x:Key="boolToVis"/> </ToggleButton.Resources> <Grid> <Image Height="auto" HorizontalAlignment="Left" Margin="5" Name="image1" Stretch="Fill" VerticalAlignment="Top" Width="auto" /> <Viewbox > <TextBlock Text="Blocked" Opacity="0.7" Foreground="Red" Visibility="{Binding Path=IsChecked, ElementName=toggleButton, Converter={StaticResource boolToVis}}"/> </Viewbox> </Grid> <ToggleButton.ContextMenu> <ContextMenu StaysOpen="True" > <MenuItem x:Name="menuItemBlock" Header="Block" Click="menuItemClick" IsCheckable="True" IsChecked="{Binding ElementName=toggleButton, Path=IsChecked}"/> <MenuItem x:Name="menuItemIgnorePtz" Header="Ignore Ptz" Click="menuItemClick" IsCheckable="True" /> </ContextMenu> </ToggleButton.ContextMenu> </ToggleButton>

    Read the article

  • WPF performance on scaling a large scene

    - by Mark
    I have a full screen app that I want to be able to zoom in on certain areas. I have the code working fine, but I notice that when I get closer in, the zoom in animation (which animates the ScaleTransform.ScaleX and ScaleTransform.ScaleY properties on a Parent canvas) starts to jerk down a little and the frame rate suffers. Im not using any BitmapEffects or anything, and ideally I would like my scene to get more complicated than it currently already is. The scene is quite large, 1980x1024, this is a requirement and cannot be changed. The current layout is like this: <Canvas x:name="LayoutRoot"> <Canvas x:Name="ContainerCanvas"> <local:MyControl x:Name="c1" /> <!-- numerous or ther controls and elements that compose the scene --> </Canvas> </Canvas> The code that zooms in just animates the RenderTransform of the ContainerCanvas, which in tern, scales its children which gives the desired effect. However, Im wondering if I need to swap out the ContainerCanvas for a ViewBox or something like that? Ive never really worked with ViewBox/Viewport controls before in WPF can they even help me out here? Smooth zooming is a huge requirement of the client and I must get this resolved. All ideas are welcome Thanks a lot Mark

    Read the article

  • XAML ContextMenu gets bound to wrong row in a DataGrid

    - by Simon_Weaver
    I have a XAML based ContextMenu bound to the rows in a datagrid. It works just fine - until the grid is scrolled! This is the context menu for one of the controls in the visual tree or a DataGrid row. <data:DataGridTemplateColumn Header="Customer Details" Width="*"> <data:DataGridTemplateColumn.CellTemplate> <DataTemplate> <Grid Background="Transparent"> <!-- allows click in entire cell --> <controlsInputToolkit:ContextMenuService.ContextMenu> <controlsInputToolkit:ContextMenu> <controlsInputToolkit:MenuItem Header="{Binding CompletedOrderId,StringFormat='Create Reminder for order #\{0\}'}" CommandParameter="{Binding}"> <controlsInputToolkit:MenuItem.Command> <command:CreateReminderCommand/> </controlsInputToolkit:MenuItem.Command> <controlsInputToolkit:MenuItem.Icon> <Viewbox> <Image Width="19" Height="18" Source="../images/reminders.png" VerticalAlignment="Center"/> </Viewbox> </controlsInputToolkit:MenuItem.Icon> </controlsInputToolkit:MenuItem> <controlsInputToolkit:ContextMenu> <controlsInputToolkit:ContextMenuService.ContextMenu> ...... The ICommand is CreateReminderCommand and the CommandParameter is bound to the data item for the row itself. This works just fine - I can right click on a row and it will show me the correct text in the menu item 'Create Reminder for order 12345'. Then I scroll the datagrid down a page. If I keep right clicking on items then suddenly I'll see the wrong order number for a row. I think what must be happening is this : The DataGrid is reusing instances of MenuItem that it has previously created. How can I force a refresh of the ContextMenu when it is displayed for an item that changes? There's no 'Update method on the ContextMenu or ContextMenuService.

    Read the article

  • How to make smooth transition from a WebBrowser control to an Image in Silverlight 4?

    - by Trex
    Hi, I have the following XAML on my page: `<Grid x:Name="LayoutRoot"> <Viewbox Stretch="Uniform"> <Image x:Name="myImage" /> </Viewbox> <WebBrowser x:Name="myBrowser" /> </Grid>` and then in the codebehind I'm switching the visibility between the image and the browser content: myBrowser.Visibility = Visibility.Collapsed; myImage.Source = new BitmapImage(new Uri(p)); myImage.Visibility = Visibility.Visible; and myImage.Visibility = Visibility.Collapsed; myBrowser.Source = new Uri(myPath + p, UriKind.Absolute); myBrowser.Visibility = Visibility.Visible; This works fine, but what the client now wants is a smooth transition between when the Image is shown and when the browser is shown. I tried several approaches but always ran into dead end. Do you have any ideas? I tried setting two states using the VSM and than displaying a white rectangle on top as an overlay, before the swap takes place, but that didn't work (I guess it's because nothing can be placed above the WebBroser???) I tried setting the Visibility of the image control and the webbrowser control using the VSM, but that didn't work either. I really don't know what else to try to solve this simple task. Any help is greatly appreciated. Jan

    Read the article

  • Text viewing in a delimited space

    - by Maurizio Reginelli
    I need to visualize a text into a delimited space. If I add a simple TextBlock I have a problem: when the text is longer than the available space, it is cropped at the end. I tried to insert the TextBlock inside a Viewbox: this solution works for a text longer than the available space, but increase the size of the text when it is shorter. Is there a way to reduce the size of the text only when it is longer than the available space?

    Read the article

  • How do I use the additional Silverlight Toolkit controls?

    - by Brett Rigby
    I've got VS2010 installed, I've downloaded the Windows Phone add-in and the Silverlight Toolkit from CodePlex, but I cannot work out for the life of me how to actually use the controls in a Windows Phone 7 application... How do I add the controls into the toolbox, or link them so that the XAML doesn't give me errors all the time? For instance, using the Viewbox - the controls aren't implemented, and the XAML does not compile.

    Read the article

1 2  | Next Page >