Search Results

Search found 758 results on 31 pages for 'blend'.

Page 6/31 | < Previous Page | 2 3 4 5 6 7 8 9 10 11 12 13  | Next Page >

  • How do I use Sketchflow sample data for a ListBoxItem Template at design time?

    - by Boris Nikolaevich
    I am using Expression Blend 4 and Visual Studio 2010 to create a Sketchflow prototype. I have a Sample Data collection and a ListBox that is bound to it. This displays as I would expect both at design time and at run time. However, the ListBoxItem template it just complex enough that I wanted to pull it out into its own XAML file. Even though the items still render as expected in the main ListBox where the template is used, when I open the template itself, all of the databound controls are empty. If I add a DataContext to the template, I can see and work with the populated objects while in the template, but then that local DataContext overrides the DataContext set on the listbox. A bit of code will illustrate. Start by creating a Sketchflow project (I am using Silverlight, but it should work the same for WPF), then add a project data source called SampleDataSource. Add a collection called ListData, with a single String property called Title. Here is the (scaled down) code for the main Sketchflow screen, which we'll call Main.xaml: <UserControl xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:local="clr-namespace:DemoScreens" mc:Ignorable="d" x:Class="DemoScreens.Main" Width="800" Height="600"> <UserControl.Resources> <ResourceDictionary> <ResourceDictionary.MergedDictionaries> <ResourceDictionary Source="ProjectDataSources.xaml"/> </ResourceDictionary.MergedDictionaries> <DataTemplate x:Key="ListBoxItemTemplate"> <local:DemoListBoxItemTemplate d:IsPrototypingComposition="True" Margin="0,0,5,0" Width="748"/> </DataTemplate> </ResourceDictionary> </UserControl.Resources> <Grid x:Name="LayoutRoot" Background="#5c87b2" DataContext="{Binding Source={StaticResource SampleDataSource}}"> <ListBox Background="White" x:Name="DemoList" Style="{StaticResource ListBox-Sketch}" Margin="20,100,20,20" ItemTemplate="{StaticResource ListBoxItemTemplate}" ItemsSource="{Binding ListData}" ScrollViewer.HorizontalScrollBarVisibility="Disabled"/> </Grid> </UserControl> You can see that it references the DemoListBoxItemTemplate, which is defined in its own DemoListBoxItemTemplate.xaml: <UserControl xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:local="clr-namespace:DemoScreens" mc:Ignorable="d" x:Class="DemoScreens.DemoListBoxItemTemplate"> <Grid x:Name="LayoutRoot"> <TextBlock Text="{Binding Title}" Style="{StaticResource BasicTextBlock-Sketch}" Width="150"/> </Grid> </UserControl> Obviously, this is way simpler than my actual listbox, but it should be enough to illustrate my problem. When you open Main.xaml in the Expression designer, the list box is populated with sample data. But when you open DemoListBoxItemTemplate.xaml, there is no data context and therefore no data to display—which makes it more difficult to identify controls visually. How can I have sample data displayed when I am working with the template, while still allowing the larger set of sample data to be used for the ListBox itself?

    Read the article

  • VS2010 asking to upgrade SIlverlight??

    - by Lu10ntDan
    I'm running the absolute latest versions of Silverlight and Visual Studio 2010 Professional and built a solution that contained a WPF project. From there, I added a SketchFlow project (based on Blend 4 RC) and I can run each project within the solution just fine by setting whenever I switch between them as startup projects. From there, I added a Silverlight 4 Business Application (taking all the defaults), and when simply trying to set that as the startup project and running it, VS2010 is giving me the following error after trying to open a web page: Line: 56 (in file TestPage.aspx) Error: Unhandled Error in Silverlight Application Code: 8001 Category: InitializeError Message: Upgrade required If I choose not to debug, I get the Silverlight page saying "This page requires a more recent version of Silverlight"! Clicking "Install Now" on the popup window brings me to Mirosoft's Silverlight page where I see: "The version of Silverlight originally requested is not available. You can get a supported version from this page. This Web browser or operating system may not be compatible with Silverlight. Please review the system requirements and, if you wish to proceed, choose the link for your operating system." If I choose to upgrade anyway, I'm told that I'm running the latest version of Silverlight available. What the heck? I'm running the final versions of VS2010 Pro, Silverlight 4, and the latest version of Expression Blend 4 (RC). Why can't VS2010 run this default Silverlight Business App? Any ideas? Please?? Thanks, Lu10ntDn PS. This is on Windows 7 with UAC turned off, and ALL latest Windows Updates installed.

    Read the article

  • Conditional execution of EventTriggers in Silverlight 3

    - by Jason
    I'm currently working on the UI of a Silverlight application and need to be able to change the visual state of a control to one of two possible states based on it's current state when handling the same event trigger. For example: I have a control that sits partially in a clipping path, when I click the visible part of the control I want to change the state to "visible" and if I click it again when it is in its "visible" state I want to change to the "hidden" state. Example XAML: <i:Interaction.Triggers> <i:EventTrigger EventName="MouseLeftButtonUp"> <ic:GoToStateAction StateName="Visible"/> <ic:GoToStateAction StateName="Hidden"/> </i:EventTrigger> </i:Interaction.Triggers> Where "i" is "System.Windows.Interactivity;assembly=System.Windows.Interactivity" and "ic" is "Microsoft.Expression.Interactivity.Core;assembly=Microsoft.Expression.Interactions". I'm currently working in Expression Blend 3 and would prefer to have a XAML only solution but am not opposed to coding this if it is completely necessary. I have tried recording a change in the target state name in Blend but this did not work. Any thoughts on this?

    Read the article

  • WPF: Restyling a window?

    - by mark smith
    Hi there, does anyone know if its possible to restyle a window in wpf. Or even better any tutorials or samples? Basically i would like to change the minimize and maximize buttons - oh and the close button to be slightly bigger.... I have expression blend.... Is this possible? I saw some samples in infragistics sample apps which have some great looking forms and as far as i can tell it doesn't use any custom wpf controls... Any ideas really appreciated

    Read the article

  • Loading an external image via XAML code in WPF?

    - by Mohammad
    I have an image lock.png beside of my WPF exe file in the images folder. Now, I'm gonna load it into the WPF Project as an image, I've used the following XAML code: <Image Stretch="Fill" Source="pack://siteoforigin:,,,/images/lock.png" /> It works, but Expression Blend or Visual Studio doesn't show it when I'm working on the project. How can we show external images in these situations?

    Read the article

  • Windows 7 Status Menu style Window

    - by Mason Blier
    Hey all, I'm working on a project and I'm wondering how to get a type of window common in Windows's wireless controls, as shown in the screen shot below: http://cybernetnews.com/wp-content/uploads/2008/10/windows-7-wireless.jpg There's no close or maximize buttons, but the border is still present. My tools include Expression Blend 3 and Visual Studio 08. I was also wondering what the font used on these are, as it doesn't seem to be the normal Tahoma found in Office 7. Thanks, Mason

    Read the article

  • Where to find Helpful Silverlight Tutorial (interactive)

    - by mw
    I want to be able to create an interactive type program where a user can pin point plots on a graph, so if a user clicks anywhere on the map a dot of some sort will be plotted. I just need a helpful tutorial on silverlight to help me do this sort of thing. I have tried looking up google but I am not finding exactly what I want. ****I am using expression blend****** Thanks

    Read the article

  • Silverlight Project - Slide-in and out Panel - How?

    - by user118190
    I don't know what exactly this feature is, but I would like to simulate this in my Silverlight project. I am a C# developer and am moving to Silverlight and Expression Studio (Blend) for richer UX. Let's say I have some user controls and would like them to come into the screen (slide-in and out) as shown in the following site I found: http://www.templatemonster.com/silverlight-templates/28722.html On the menu, as one clicks on the menu item, the 'screen' slides to the left and then a new 'screen' slides in from the left to right. I really want to learn this stuff, but don't know what these 'features' are called? For example what are these 'screens' called in the xaml world? Also, what is the 'slide-in/out' called in the xaml world? Can someone point me to a good article/whitepaper? Thanks in advance for any advice.

    Read the article

  • Visual Studio 2010 RC with .net 4 beta 2

    - by aip.cd.aish
    Does anyone know if it is possible to use Visual Studio 2010 RC with the beta 2 version of the .NET 4 framework? The reason I need to use the beta 2 version and not the RC is that there isn't an Expression Blend that can support the .NET 4 RC. I uninstalled the .NET 4 framework that installed with Visual Studio 2010, then I reinstalled the .NET 4 version Beta 2. But now when I launch Visual Studio, I get an error message saying "The operation could not be completed" and it shuts down. How can I make this work? Thanks!

    Read the article

  • WPF NotifyIcon Help C#

    - by Sandeep Bansal
    Hi everyone. I'm having trouble with a NotifyIcon in WPF I currently have the following: notifyI = new NotifyIcon(); notifyI.Icon = new Icon("Power.ico"); notifyI.Text = "Shutdown Timer"; notifyI.Visible = true; notifyI.MouseDoubleClick += new System.Windows.Forms.MouseEventHandler(notifyI_MouseDoubleClick); The thing is the notifyI.Icon = new Icon("Power.ico") is keep throwing and exception. I can't seem to find a way to use the icon file I have in the resources, can anyone help. Thanks, I am using VS2010 and Blend 3.

    Read the article

  • When to use UserControl vs. Control in Silverlight?

    - by Dov
    I'm just getting my feet wet in Silverlight, and don't really understand the differences and pros/cons of creating a UserControl vs. creating a Control for the same task (as in when you right click on a selection in Expression Blend, for instance). It seems like selecting "Make Into Control" just creates a new template for the base type you specify, whereas creating a UserControl creates a whole new base class. Is that correct? In this particular instance, I'm creating a custom text box control that only takes numbers, and divides itself into 3 sections, storing 3 values into separate properties as pictured below. In this particular case, which would be best? Update (Additional Question): Why can't I use Template Binding with a UserControl, but I can with a Control? That's one reason I thought that making a UserControl might not be the right decision.

    Read the article

  • The property 'IsDataSource' was not found in type 'ViewModelLocator

    - by dieter-preconsult-be
    Hello I have the following code: <UserControl x:Class="TestApp.View.ViewAlarmLog" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:Custom="http://schemas.microsoft.com/wpf/2008/toolkit" xmlns:mvvm="clr-namespace:Test.ViewModel"> <UserControl.Resources> <ResourceDictionary > <ResourceDictionary.MergedDictionaries> </ResourceDictionary.MergedDictionaries> <mvvm:ViewModelLocator x:Key="Locator" d:IsDataSource="True"/> </ResourceDictionary> </UserControl.Resources> the problem is dat i always get an error: The property 'IsDataSource' was not found in type 'ViewModelLocator'. " What could be the problem here ? Redgards Dieter

    Read the article

  • Read XML from an XDocument with silverlight

    - by user625310
    Hi I have managed to load an XDocument with xml data from this link http://go.yr.no/go/e/main/http://www.yr.no/place/Norway/Telemark/Sauherad/Gvarv/forecast.xml. I am using C# and .Net in Blend and producing a web app (ie some of the normal .Net functions is not included in the silverlight plugin). I have researched this a lot but can not figure out: how to put the "text" in the link node in a string variable and how to all put the "-11" from ? in a array and link it to the "time from"? I think i have to use LINQ, but the stuff on MSDN and other tutorials is confusing and to general. huge thank in advance Regards Arnt I am sorry to ask such novice questions, but i have searched a lot. Also please excuse the typos, English is not my first language. Huge thank in advance Arnt

    Read the article

  • Icons in Silverlight: Images vs. Vectors

    - by Shnitzel
    I like using the vector drawing feature of Expression Blend to create icons. That way I can change colors easily on my icons without having to resort to an image editor. But my question is... Say I have a treeview control that has an icon next to each tree element and say I have hundreds of elements. Do you think using images is faster - performance wise than using vector icons? B/c I'd rather use vectors but I'm wondering about performance concerns.

    Read the article

  • OpenGLES iPhone Depth Blending problem

    - by user359103
    Hi, I am trying to make an OpenGLES 2.0 cube application. The idea was to have a texture (with an alpha 75%) applied to all 6 faces of the cube. This would mean that even if I rotate the cube i would be able to see all 6 faces at any given frame. Now I have enabled depth test(my app needs this!!) and blending. The Depth func is LEQUAL and blend func is SRC_ALPHA, ONE_MINUS_SRC_ALPHA. Now, the issue is that at some cube faces don't show the underlying faces. I am not able to understand this because the logic works fine with the other cube faces. Just for the record, I have disabled CULL_FACE. Thanks in advance. Regards, Puzzler

    Read the article

  • Automatically calling OnDetaching() for Silverlight Behaviors

    - by Dan Auclair
    I am using several Blend behaviors and triggers on a silverlight control. I am wondering if there is any mechanism for automatically detaching or ensuring that OnDetaching() is called for a behavior or trigger when the control is no longer being used (i.e. removed from the visual tree). My problem is that there is a managed memory leak with the control because of one of the behaviors. The behavior subscribes to an event on some long-lived object in the OnAttached() override and should be unsubscribing to that event in the OnDetaching() override so that it can become a candidate for garbage collection. However, OnDetaching() never seems to be getting called when I remove the control from the visual tree... the only way I can get it to happen is by explicit detaching the behavior BEFORE removing the control and then it is properly garbage collected. Right now my only solution was to create a public method in the code-behind for the control that can go through and detach any known behaviors that would cause garbage collection problems. It would be up to the client code to know to call this before removing the control from the panel. I don't really like this approach, so I am looking for some automatic way of doing this that I am overlooking or a better suggestion. public void DetachBehaviors() { foreach (var behavior in Interaction.GetBehaviors(this.LayoutRoot)) { behavior.Detach(); } //... //continue detaching all known problematic behaviors.... }

    Read the article

  • What shall be the code in xaml which makes a particular image to act as a button?

    - by Abhi
    Dear all I am new to Silverlight. And i have to make a demo application where in designing is done by using Microsoft Expression Blend 2 and developing should be done using Visual Studio(c++). Now i am first trying to become familiar with xaml files. So i was trying to make a simple demo where in i have to create a button and that button should be replace with an png image. In order to do so i tried with the mentioned below example. But i was not able to see anything in the screen. <UserControl xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" x:Class="SilverlightApplication1.Page" Width="640" Height="480"> <Grid x:Name="LayoutRoot" Background="White"> <Button x:Name="LogoutButton" > <Button.Template> <ControlTemplate> <Image Source="SilverlightApplication1\bounce_photo.png" /> </ControlTemplate> </Button.Template> </Button> </Grid> Please let me know where i am wrong and what shall i do to obtain the result. With regards Abhineet Agarwal

    Read the article

  • Nested AccordionItem. Inner AccordionItem do not expand.

    - by Ali
    In Silverlight an AccordionItem is inside another one . When the inner one is selected, it can not expand its parent more which is already expanded to show its own content. I tried to get around it by templating but I was unlucky. Does any one has a solution for it [prefer a solution without code]? <UserControl xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:layoutPrimitivesToolkit="clr-namespace:System.Windows.Controls.Primitives;assembly=System.Windows.Controls.Layout.Toolkit" xmlns:layoutToolkit="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Layout.Toolkit" xmlns:controlsToolkit="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Toolkit" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d" x:Class="NestedAccordion_Silverlight.MainPage" Width="640" Height="480"> <Grid x:Name="LayoutRoot" Background="White"> <layoutToolkit:Accordion BorderBrush="#FF00FF53" SelectionMode="ZeroOrMore"> <layoutToolkit:AccordionItem Header="Header" VerticalAlignment="Top" > <StackPanel VerticalAlignment="Top"> <TextBlock TextWrapping="Wrap" Text="Some content"/> <Button Content="Button" Width="75"/> <layoutToolkit:AccordionItem Header="Inner Accordion1" VerticalAlignment="Top" > <StackPanel VerticalAlignment="Top"> <TextBlock TextWrapping="Wrap" Text="Some content"/> <Button Content="Button" Width="75"/> </StackPanel> </layoutToolkit:AccordionItem> </StackPanel> </layoutToolkit:AccordionItem> <layoutToolkit:AccordionItem Header="Header" VerticalAlignment="Top" > <StackPanel> <TextBlock TextWrapping="Wrap" Text="Some content"/> <Button Content="Button" Width="75"/> </StackPanel> </layoutToolkit:AccordionItem> <layoutToolkit:AccordionItem Header="Header" VerticalAlignment="Top" > <StackPanel> <TextBlock TextWrapping="Wrap" Text="Some content"/> <Button Content="Button" Width="75"/> </StackPanel> </layoutToolkit:AccordionItem> </layoutToolkit:Accordion> </Grid> Is it a bug or I am in a wrong path?

    Read the article

  • How do you make the scale animation begin at the middle of the object instead of the top left?

    - by Roy
    What I am trying to accomplish: 10 percent increase scale transformation of a rectangle via Silverlight storyboard animation. What I currently doing: While in Expression Blend 3, I created a rectangle, created a storyboard, and created the scale transformation. The preview looked correct because the increase in scale begins in the middle of the object. When I run the project the scale transformation begins at the top left. Is there some piece of code missing? Here is my current code: <UserControl xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" x:Class="TestingGroundsWebsite.MainPage" Width="640" Height="480"> <UserControl.Resources> <Storyboard x:Name="RectangleAppear"> <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="rectangle" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleX)"> <EasingDoubleKeyFrame KeyTime="00:00:00" Value="0.1"/> <EasingDoubleKeyFrame KeyTime="00:00:01" Value="1.1"/> <EasingDoubleKeyFrame KeyTime="00:00:02" Value="1"/> </DoubleAnimationUsingKeyFrames> <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="rectangle" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleY)"> <EasingDoubleKeyFrame KeyTime="00:00:00" Value="0.1"/> <EasingDoubleKeyFrame KeyTime="00:00:01" Value="1.1"/> <EasingDoubleKeyFrame KeyTime="00:00:02" Value="1"/> </DoubleAnimationUsingKeyFrames> </Storyboard> </UserControl.Resources> <Canvas x:Name="LayoutRoot" Background="White"> <Rectangle x:Name="rectangle" Fill="#FFE80000" Stroke="Black" Height="75" Width="76" Canvas.Left="227" Canvas.Top="167" RenderTransformOrigin="0.5,0.5"> <Rectangle.RenderTransform> <TransformGroup> <ScaleTransform/> <SkewTransform/> <RotateTransform/> <TranslateTransform/> </TransformGroup> </Rectangle.RenderTransform> </Rectangle> </Canvas> </UserControl> Thanks

    Read the article

  • WPF - How can I place a usercontrol over an AdornedElementPlaceholder?

    - by Kevin
    I'm trying to get the validation to not show through my custom modal dialog. I've tried setting the zindex of the dialog and and of the elements in this template. Any ideas? This is coming from a validation template: <ControlTemplate x:Key="ValidationTemplate"> <DockPanel> <TextBlock Foreground="Red" FontSize="20" Panel.ZIndex="-10">!</TextBlock> <Border Name="validationBorder" BorderBrush="Red" BorderThickness="2" Padding="1" CornerRadius="3" Panel.ZIndex="-10"> <Border.Resources> <Storyboard x:Key="_blink"> <ColorAnimationUsingKeyFrames AutoReverse="True" BeginTime="00:00:00" Storyboard.TargetName="validationBorder" Storyboard.TargetProperty="(Border.BorderBrush).(SolidColorBrush.Color)" RepeatBehavior="Forever"> <SplineColorKeyFrame KeyTime="00:00:1" Value="#00FF0000"/> </ColorAnimationUsingKeyFrames> </Storyboard> </Border.Resources> <Border.Triggers> <EventTrigger RoutedEvent="FrameworkElement.Loaded"> <BeginStoryboard Storyboard="{StaticResource _blink}" /> </EventTrigger> </Border.Triggers> <AdornedElementPlaceholder/> </Border> </DockPanel> </ControlTemplate> The dialog: <UserControl xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" x:Class="GunMiser.Controls.PendingChangesConfirmationDialog" Height="768" Width="1024" mc:Ignorable="d"> <Grid Background="White"> <Rectangle x:Name="MainRectangle" Margin="0,0,0,0" Style="{DynamicResource UserControlOverlayRectangleStyle}" Opacity="0.85"/> <Border Margin="288,250,278,288" Background="#FF868686" BorderBrush="Black" BorderThickness="1"> <Border.Effect> <DropShadowEffect Color="#FFB6B2B2"/> </Border.Effect> <TextBlock x:Name="textBlockMessage" Margin="7,29,7,97" TextWrapping="Wrap" d:LayoutOverrides="VerticalAlignment" TextAlignment="Center"/> </Border> <Button x:Name="OkButton" Click="OkButton_Click" Margin="313,0,0,328" VerticalAlignment="Bottom" Height="24" Content="Save Changes" Style="{DynamicResource GunMiserButtonStyle}" HorizontalAlignment="Left" Width="103"/> <Button Click="CancelButton_Click" Margin="453.294,0,456,328" VerticalAlignment="Bottom" Height="24" Content="Cancel Changes" Style="{DynamicResource GunMiserButtonStyle}"/> <Button Click="CancelActionButton_Click" Margin="0,0,304,328" VerticalAlignment="Bottom" Height="24" Content="Go Back" Style="{DynamicResource GunMiserButtonStyle}" HorizontalAlignment="Right" Width="114.706"/> </Grid> </UserControl> And the overall window is: <Window x:Class="GunMiser.Views.Shell" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:cal="http://www.codeplex.com/CompositeWPF" xmlns:controls="clr-namespace:GunMiser.Controls;assembly=GunMiser.Controls" Title="Gun Miser" Height="768" Width="1024"> <Canvas> <controls:PendingChangesConfirmationDialog x:Name="PendingChangesConfirmationDialog" HorizontalAlignment="Stretch" Margin="0,0,0,0" VerticalAlignment="Stretch" Width="1008" Height="730" Visibility="Collapsed" Panel.ZIndex="100" /> <ContentControl x:Name="FilterRegion" cal:RegionManager.RegionName="FilterRegion" Width="326" Height="656" Canvas.Top="32" VerticalAlignment="Top" HorizontalAlignment="Left" /> <ContentControl Name="WorkspaceRegion" cal:RegionManager.RegionName="WorkspaceRegion" Width="678" Height="726" Canvas.Left="330" VerticalAlignment="Top" HorizontalAlignment="Left"/> <Button Click="GunsButton_Click" Width="75" Height="25" Content="Guns" Canvas.Top="3" Style="{DynamicResource GunMiserButtonStyle}"/> <Button Click="OpticsButton_Click" Width="75" Height="25" Content="Optics" Canvas.Left="81" Canvas.Top="3" Style="{DynamicResource GunMiserButtonStyle}"/> <Button Click="SettingsButton_Click" Width="56" Height="28" Content="Settings" Canvas.Left="944" Style="{DynamicResource GunMiserButtonStyle}" HorizontalAlignment="Left" VerticalAlignment="Top"/> <Button Click="AccessoriesButton_Click" Width="75" Height="25" Content="Accessories" Canvas.Left="239" Canvas.Top="3" Style="{DynamicResource GunMiserButtonStyle}"/> <Button Click="AmmunitionButton_Click" Width="75" Height="25" Content="Ammunition" Canvas.Left="160" Canvas.Top="3" Style="{DynamicResource GunMiserButtonStyle}"/> </Canvas> </Window>

    Read the article

  • How do I make a simple image-based button with visual states in Silverlight 3?

    - by Jacob
    At my previous company, we created our RIAs using Flex with graphical assets created in Flash. In Flash, you could simply lay out your graphics for different states, i.e. rollover, disabled. Now, I'm working on a Silverlight 3 project. I've been given a bunch of images that need to serve as the graphics for buttons that have a rollover, pressed, and normal state. I cannot figure out how to simply create buttons with different images for different visual states in Visual Studio 2008 or Expression Blend 3. Here's where I am currently. My button is defined like this in the XAML: <Button Style="{StaticResource MyButton}"/> The MyButton style appears as follows: <Style x:Key="MyButton" TargetType="Button"> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="Button"> <Image Source="/Assets/Graphics/mybtn_up.png" Width="54" Height="24"> <VisualStateManager.VisualStateGroups> <VisualStateGroup x:Name="FocusStates"> <VisualState x:Name="Focused"/> <VisualState x:Name="Unfocused"/> </VisualStateGroup> <VisualStateGroup x:Name="CommonStates"> <VisualState x:Name="Normal"/> <VisualState x:Name="MouseOver"/> <VisualState x:Name="Pressed"/> <VisualState x:Name="Disabled"/> </VisualStateGroup> </VisualStateManager.VisualStateGroups> </Image> </ControlTemplate> </Setter.Value> </Setter> </Style> I cannot figure out how to assign a different template to different states, nor how to change the image's source based on which state I'm in. How do I do this? Also, if you know of any good documentation that describes how styles work in Silverlight, that would be great. All of the search results I can come up with are frustratingly unhelpful. Edit: I found a way to change the image via storyboards like this: <Style x:Key="MyButton" TargetType="Button"> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="Button"> <Image Source="/Assets/Graphics/mybtn_up.png" Width="54" Height="24" x:Name="Image"> <VisualStateManager.VisualStateGroups> <VisualStateGroup x:Name="FocusStates"> <VisualState x:Name="Focused"/> <VisualState x:Name="Unfocused"/> </VisualStateGroup> <VisualStateGroup x:Name="CommonStates"> <VisualState x:Name="Normal"/> <VisualState x:Name="MouseOver"> <Storyboard Storyboard.TargetName="Image" Storyboard.TargetProperty="Source"> <ObjectAnimationUsingKeyFrames> <DiscreteObjectKeyFrame KeyTime="0" Value="/Assets/Graphics/mybtn_over.png"/> </ObjectAnimationUsingKeyFrames> </Storyboard> </VisualState> <VisualState x:Name="Pressed"> <Storyboard Storyboard.TargetName="Image" Storyboard.TargetProperty="Source"> <ObjectAnimationUsingKeyFrames> <DiscreteObjectKeyFrame KeyTime="0" Value="/Assets/Graphics/mybtn_active.png"/> </ObjectAnimationUsingKeyFrames> </Storyboard> </VisualState> <VisualState x:Name="Disabled"/> </VisualStateGroup> </VisualStateManager.VisualStateGroups> </Image> </ControlTemplate> </Setter.Value> </Setter> </Style> However, this seems like a strange way of doing things to me. Is there a more standard way of accomplishing this?

    Read the article

  • How to edit a StoryBoard to put it in a Button Style ?

    - by pi-corellis
    Hello, I've created a storyboard for a button in blend that I want it to apply everytime the button is pressed, So I tried to create a style,I've been stucked for a long time now. here is the code of my Storyboard: <Storyboard> <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.ScaleX)" Storyboard.TargetName="button"> <EasingDoubleKeyFrame KeyTime="0" Value="1"> <EasingDoubleKeyFrame.EasingFunction> <CubicEase EasingMode="EaseOut"/> </EasingDoubleKeyFrame.EasingFunction> </EasingDoubleKeyFrame> <EasingDoubleKeyFrame KeyTime="0:0:0.25" Value="0.85"> <EasingDoubleKeyFrame.EasingFunction> <QuinticEase EasingMode="EaseInOut"/> </EasingDoubleKeyFrame.EasingFunction> </EasingDoubleKeyFrame> <EasingDoubleKeyFrame KeyTime="0:0:0.5" Value="1"> <EasingDoubleKeyFrame.EasingFunction> <QuarticEase EasingMode="EaseIn"/> </EasingDoubleKeyFrame.EasingFunction> </EasingDoubleKeyFrame> </DoubleAnimationUsingKeyFrames> <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.ScaleY)" Storyboard.TargetName="button"> <EasingDoubleKeyFrame KeyTime="0" Value="1"> <EasingDoubleKeyFrame.EasingFunction> <CubicEase EasingMode="EaseOut"/> </EasingDoubleKeyFrame.EasingFunction> </EasingDoubleKeyFrame> <EasingDoubleKeyFrame KeyTime="0:0:0.25" Value="0.85"> <EasingDoubleKeyFrame.EasingFunction> <QuinticEase EasingMode="EaseInOut"/> </EasingDoubleKeyFrame.EasingFunction> </EasingDoubleKeyFrame> <EasingDoubleKeyFrame KeyTime="0:0:0.5" Value="1"> <EasingDoubleKeyFrame.EasingFunction> <QuarticEase EasingMode="EaseIn"/> </EasingDoubleKeyFrame.EasingFunction> </EasingDoubleKeyFrame> </DoubleAnimationUsingKeyFrames> And Here is the code of my button style: <Style x:Key="ParametersButton" TargetType="ButtonBase" > <Setter Property="Background" Value="{StaticResource TransparentBrush}"/> <Setter Property="BorderBrush" Value="{StaticResource PhoneForegroundBrush}"/> <Setter Property="Foreground" Value="{StaticResource PhoneForegroundBrush}"/> <Setter Property="MinHeight" Value="72" /> <Setter Property="BorderThickness" Value="{StaticResource PhoneDefaultBorderThickness}"/> <Setter Property="FontFamily" Value="{StaticResource PhoneFontFamilyNormal}"/> <Setter Property="FontSize" Value="{StaticResource PhoneFontSizeMediumLarge}"/> <Setter Property="Padding" Value="0,15,15,0"/> <Setter Property="Height" Value="72"/> <Setter Property="Width" Value="72"/> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="ButtonBase"> <Grid Background="Transparent" > <VisualStateManager.VisualStateGroups> <VisualStateGroup x:Name="CommonStates"> <VisualState x:Name="Normal"/> <VisualState x:Name="MouseOver"/> <VisualState x:Name="UnPressed"/> <VisualState x:Name="Pressed"> <Storyboard> <!--Here is where I want to insert my StoryBoard--> </Storyboard> </VisualState> <VisualState x:Name="Disabled"/> </VisualStateGroup> <VisualStateGroup x:Name="FocusStates"> <VisualState x:Name="Focused"/> <VisualState x:Name="Unfocused"/> </VisualStateGroup> </VisualStateManager.VisualStateGroups> <Border x:Name="ButtonBackground" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="0" CornerRadius="0" Background="#FF1BA1E2" Margin="{StaticResource PhoneTouchTargetOverhang}" RenderTransformOrigin="0.5,0.5"> <ContentControl x:Name="foregroundContainer" FontFamily="{TemplateBinding FontFamily}" Foreground="{TemplateBinding Foreground}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" FontSize="{TemplateBinding FontSize}" Padding="{TemplateBinding Padding}" Content="{TemplateBinding Content}" ContentTemplate="{TemplateBinding ContentTemplate}"/> </Border> </Grid> </ControlTemplate> </Setter.Value> </Setter> How can I proceed ? Thanks, Renaud

    Read the article

  • Morph a sphere to a cube and a cube to a sphere with GLSL

    - by nkint
    I'm getting started with GLSL with quartz composer. I have a patch with a particle system in which each particle is mapped into a sphere with a blend value. With blend=0 particles are in random positions, blend=1 particles are in the sphere. The code is here: vec3 sphere(vec2 domain) { vec3 range; range.x = radius * cos(domain.y) * sin(domain.x); range.y = radius * sin(domain.y) * sin(domain.x); range.z = radius * cos(domain.x); return range; } // in main: vec2 p0 = gl_Vertex.xy * twopi; vec3 normal = sphere(p0);; vec3 r0 = radius * normal; vec3 vertex = r0; normal = normal * blend + gl_Normal * (1.0 - blend); vertex = vertex * blend + gl_Vertex.xyz * (1.0 - blend); I'd like the particle to be on a cube if blend=0 I've tried to find but I can't figure out some parametric equation for the cube. Maybe it is not the right way?

    Read the article

  • Expression Studio 4 Launch of Blend, SketchFlow, Encoder and More!

    Today Expression Studio 4 (which includes Expression Blend, SketchFlow, Expression Web, Expression Design, Expression Encoder) launched at the Internet Week conference in New York City! There are a ton of new features in these products, some of which we have shown off already in some episodes of Silverlight TV a http://silverlight.tv. You can visit www.microsoft.com/expression to find out more about Expression and you can download a trial. Owners of v3 Expression Studio or Expression Web can upgrade...Did you know that DotNetSlackers also publishes .net articles written by top known .net Authors? We already have over 80 articles in several categories including Silverlight. Take a look: here.

    Read the article

< Previous Page | 2 3 4 5 6 7 8 9 10 11 12 13  | Next Page >