Search Results

Search found 2453 results on 99 pages for 'xaml'.

Page 8/99 | < Previous Page | 4 5 6 7 8 9 10 11 12 13 14 15  | Next Page >

  • Is there a measurestring equivalent in Silverlight xaml?

    - by Roy
    What I am trying to accomplish: Create a dynamic bubble that expands on height and width depending on the text in the bubble. What I researched so far: In an so article they described the measurestring to figure out the exact width or height so dynamic changes in the .cs to the width and height can be accomplished. Is there something like this in Silverlight? Is my only option to utilize the myTxt.Text.length and then change the myGrid.height and myGrid.width to leave wasted space to accommodate all cases?

    Read the article

  • XAML ComboBox SelectionChanged Fires OnLoad

    - by griegs
    If I have a ComboBox that has a SelectionChanged event, it fires when I'm loading the control. So at page load I set the SelectedValue and the SelectionChanged event fires which is not what I want to happen. What is the accepted apporach to stopping this?

    Read the article

  • Current Date in Silverlight XAML TextBlock

    - by user292110
    I am coming from Flex where you can do just about anything inside of curly braces. I am trying to get a TextBlock to display today's Date and Time without just coding it in C#. I have tried many different variations of the following with no luck. TextBlock Text="{Source=Date, Path=Now, StringFormat='dd/MM/yyyy'}" I know I could probably just set a property MyDate and bind to that but why can't I bind directly to the DateTime.Now property?

    Read the article

  • How do I stop inheritance in xaml?

    - by cfouche
    Hi Let's say I have some Control that has been disabled. It contains a bunch of elements, but I want one of those child elements to remain enabled. Something like this: <ContentControl IsEnabled="False"> <Border> <Button Content="Button" IsEnabled="True"/> </Border> </ContentControl> So in this example, the Button's IsEnabled="True" setting gets overridden by its parent. Is there a way of stopping this from happening? This seems like a strange thing to be doing, but I have a situation where, when a Control is disabled and a user mouses down on it, I still want an event to be triggered. I read in WPF Unleashed that wrapping something in a Frame control, "..isolates the content from the rest of the UI [and] properties that would normally be inherited down the element tree stop when they reach the Frame", but wrapping the Button in the example above in a Frame doesn't work. Am I on the wrong track here?

    Read the article

  • putting multibinding on a single line in xaml

    - by Adam S
    Is there a way to take this multibinding: <TextBox.IsEnabled> <MultiBinding Converter="{StaticResource LogicConverter}"> <Binding ElementName="prog0_used" Path="IsEnabled" /> <Binding ElementName="prog0_used" Path="IsChecked" /> </MultiBinding> </TextBox.IsEnabled> and put is all on one line, as in <TextBox IsEnabled="" />? If so, where can I learn the rules of this formattiong?

    Read the article

  • XAML ToolTip + IsHitTestVisible="False"

    - by Sean
    We need to have mouse clicks and drags "ignored" by our View1 but the ToolTip must still function in that view. The reason is View1 is above View2 in Z-Order, so View1 can tint View2 a red color and show a warning via ToolTip; however the ToolTip accompanying View1 will not work if IsHitTestVisible="False". Anyone know a work around so the ToolTip will display on mouse move/over and the rest of mouse events are ignored by View1 and go to View2? Thanks, Sean

    Read the article

  • Silverlight XAML layout issue

    - by George2
    Hello everyone, I am using Silverlight 3.0 + .Net 3.5 + VSTS 2008 + C# to develop a simple video application using the open source slvideoplayer of Silverlight. http://slvideoplayer.codeplex.com/ For the player, the play control is at the bottom of the rendering video, any ideas how to place play control at the top of video? I have tried hard but can not figure out. Any solutions? thanks in advance, George

    Read the article

  • Declare a Nullable int (int?) using XAML

    - by Nate Zaugg
    I am trying to bind a combo box to a property on my ViewModel. The target type is short? and I would like to have null be an option. Basically I would like the value of the first item in the combo box be {x:Null}. <ComboBox Grid.Row="9" Grid.Column="1" SelectedValue="{Binding Priority}"> <clr:Int16></clr:Int16> <clr:Int16>1</clr:Int16> <clr:Int16>2</clr:Int16> <clr:Int16>3</clr:Int16> <clr:Int16>4</clr:Int16> <clr:Int16>5</clr:Int16> <clr:Int16>6</clr:Int16> <clr:Int16>7</clr:Int16> <clr:Int16>8</clr:Int16> <clr:Int16>9</clr:Int16> <clr:Int16>10</clr:Int16> </ComboBox> Any Suggestions?

    Read the article

  • iterating resourcedictionary xaml file

    - by Sdry
    I am trying to display an amount of colorpicker controls depending on an amount of colors in a xamnl resourcedictionary file. For some reason I can't figure out the right way to do this. When loading it in through a XAMLReader to a ResourcesDictionary Object, I m not sure what is the best way to iterate over it. I had first tried to handle it as xml, using XDocument.Elements() which gave an empty IEnumerable when trying to get al the elements. What is the best way to do this ?

    Read the article

  • wpf: design time error while writing Nested type in xaml

    - by viky
    I have created a usercontrol which accept type of enum and assign the values of that enum to a ComboBox control in that usercontrol. Very Simple. I am using this user control in DataTemplates. Problem comes when there comes nested type. I assign that using this notation EnumType="{x:Type myNamespace:ParentType + NestedType}" It works fine at runtime. but at design time it throws error saying Could not create an instance of type 'TypeExtension' Why? Due to this I am not able to see my window at design time. Any help?

    Read the article

  • Scope of controls inside Silverlight XAML

    - by synergetic
    I have defined a textbox with x:Name="txtMyTextBox" inside UserControl called MyView. I've noticed that I can do the following: MyView myView = new MyView(); myView.txtMyTextBox.Text = "something"; Why txtMyTextBox is accessible that way? Is it public or internal field? Can I make it private?

    Read the article

  • How do you replace an entire xaml element?

    - by luke
    <ListView> <ListView.Resources> <DataTempalte x:Key="label"> <TextBlock Text="{Binding Label}"/> </DataTEmplate> <DataTemplate x:Key="editor"> <UserControl Content="{Binding Control.content}"/> <!-- This is the line --> </DataTemplate> </ListView.Resources> <ListView.View> <GridView> <GridViewColumn Header="Name" CellTemplate="{StaticResource label}"/> <GridViewColumn Header="Value" CellTemplate="{StaticResource editor}"/> </GridView> </ListView.View> On the marketed line, I'm replacing the contents of a UserControl with the contents of another UserControl that is dynamically created in code. I'd like to replace the entire control, and not just the content. Is there a way to do this?

    Read the article

  • Function call within XAML code?

    - by Matt H.
    I'd like to set a style on all my TextBox controls that does the following when it receives keyboard focus: 1) Change the background color 2) Call .SelectAll() to highlight all text I have this so far: <Style TargetType="TextBox"> <Style.Triggers> <Trigger Property="IsKeyboardFocusWithin" Value="True"> <Setter Property="Background"> <Setter.Value> <SolidColorBrush Color="#FFFFD1D9"/> </Setter.Value> </Setter> </Trigger> </Style.Triggers> </Style> Is there a way to also call .SelectAll() ? Thanks.

    Read the article

  • How to adjust padding in xaml label

    - by Bjarne
    How can I make the top and bottom padding smaller in the following label? As I see it, the bounding box in much bigger than it needs to be, but the padding is set to 0, so it cannot be any smaller. <Label Background="AliceBlue" Content="1800" FontSize="170" FontWeight="Bold" Foreground="Gray" Padding="0" />

    Read the article

  • XAML-based applications - Event Naming Conventions for C#

    - by user118190
    For event handling, I am starting to see many coders doing this: XButton.Click += OnXButtonClicked() ... void OnXButtonClicked() { ... } Where did this On_ convention come from? It just doesn't feel right in terms of methods. I am starting to see this as well and am wondering what others thought: XButton.Click += HandleXButtonClick() ... void HandleXButtonClick() { ... } When using intellisense, Visual Studio handles these like so: XButton.Click += XButton_Click; ... void XButton_Click(object sender, RoutedEventArgs e) { ... } I am seeking some advice on these naming conventions and would greatly appreciate some advice.

    Read the article

  • XAML Setter Property to Command

    - by Kevin
    I am trying to call a command when my mouse is over a toggle button. I have the following code. <Trigger Property="IsMouseOver" Value="True"> <Setter Property="Cursor" Value="Hand"></Setter> <Setter Property="Command" Value="{Binding Path=PushPinMouse}" /> </Trigger> When I roll the mouse over, the hand shows. But when i roll the mouse over it doesn't hit my PushPinMouse method.. Why's that?

    Read the article

  • WPF: how to define collections for use in xaml

    - by Aran Mulholland
    I want to define something like this <myCustomControl> <myCustomControl.Images> <Image Source="{StaticResource LockedIcon16}" /> <Image Source="{StaticResource UnlockedIcon16}"/> <myCustomControl.Images> <myCustomControl/> what property definitions do i need to get that collection (Images) happening?

    Read the article

  • XAML PixelGrid to Prevent Blurry Text

    - by Bodekaer
    Hi, Just wanted to share a small Grid I created, which can help prevent blurry text etc. as it adjusts the margin of the Grid to ensure a pixel perfect position and size of the grid. Works great e.g. for inside StackPanels with auto height Labels/TextBlocks. Here is the code: using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Windows; using System.Windows.Controls; using System.Windows.Media; namespace Controls { class PixelGrid : Grid { protected override void OnRenderSizeChanged(SizeChangedInfo sizeInfo) { // POSITION Vector position = VisualTreeHelper.GetOffset(this); double targetX = Math.Round(position.X, MidpointRounding.ToEven); double targetY = Math.Round(position.Y, MidpointRounding.ToEven); double marginLeft = targetX - position.X; double marginTop = targetY - position.Y; // SIZE double targetHeight = Math.Round(sizeInfo.NewSize.Height, MidpointRounding.ToEven); double targetWidth = Math.Round(sizeInfo.NewSize.Width, MidpointRounding.ToEven); double marginBottom = targetHeight - sizeInfo.NewSize.Height; double marginRight = targetWidth - sizeInfo.NewSize.Width; // Adjust margin to ensure pixel width this.Margin = new Thickness(marginLeft, marginTop, marginRight, marginBottom); base.OnRenderSizeChanged(sizeInfo); } } }

    Read the article

  • Windows Phone 8 xaml textblock binding format

    - by user2042227
    I would like to format a textblock which is binded to a value, to show "R" before the actuall value, is this possible, cause I cannot directly change the value? Thank you <ListBox x:Name="lstbundleListbox" Foreground="White" Height="320" HorizontalAlignment="Center"> <ListBox.ItemContainerStyle> <Style TargetType="ListBoxItem"> <Setter Property="HorizontalContentAlignment" Value="Center" /> </Style> </ListBox.ItemContainerStyle> <ListBox.ItemTemplate> <DataTemplate> <StackPanel> <TextBlock Text="{Binding name}" TextWrapping="Wrap" HorizontalAlignment="Center"/> <TextBlock Text="{Binding cost}" TextWrapping="Wrap" HorizontalAlignment="Center"/> </StackPanel> </DataTemplate> </ListBox.ItemTemplate> <ItemsControl.ItemsPanel> <ItemsPanelTemplate> <StackPanel Orientation="Vertical"/> </ItemsPanelTemplate> </ItemsControl.ItemsPanel> </ListBox> So I basically want the texblock to show R(cost)

    Read the article

  • How to find if a Item in a ListBox has the focus?

    - by eitan barazani
    I have a List box defined like this: <ListBox x:Name="EmailList" ItemsSource="{Binding MailBoxManager.Inbox.EmailList}" SelectedItem="{Binding SelectedMessage, Mode=TwoWay}" Grid.Row="1"> <ListBox.ItemTemplate> <DataTemplate> <usrctrls:MessageSummary /> </DataTemplate> </ListBox.ItemTemplate> </ListBox> The UserControl is defined like this: <UserControl x:Class="UserControls.MessageSummary" 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" mc:Ignorable="d" d:DesignHeight="300" d:DesignWidth="600"> <UserControl.Resources> </UserControl.Resources> <Grid HorizontalAlignment="Left"> <Grid.ColumnDefinitions> <ColumnDefinition Width="50" /> <ColumnDefinition Width="*" /> </Grid.ColumnDefinitions> <CheckBox Grid.Column="0" VerticalAlignment="Center" /> <Grid Grid.Column="1" Margin="0,0,12,0"> <Grid.RowDefinitions> <RowDefinition /> <RowDefinition /> <RowDefinition /> </Grid.RowDefinitions> <Grid Grid.Row="0" Grid.Column="0" HorizontalAlignment="Stretch"> <Grid.ColumnDefinitions> <ColumnDefinition Width="30" /> <ColumnDefinition Width="*" /> <ColumnDefinition Width="80" /> <ColumnDefinition Width="80" /> </Grid.ColumnDefinitions> <Image x:Name="FlaggedImage" Grid.Column="0" Width="20" Height="10" Margin="0" VerticalAlignment="Center" HorizontalAlignment="Center" Source="/Assets/ico_flagged_white.png" /> <TextBlock x:Name="Sender" Grid.Column="1" Text="{Binding EmailProperties.DisplayFrom}" Style="{StaticResource TextBlock_SenderRowTitle}" HorizontalAlignment="Left" VerticalAlignment="Center" /> <Grid x:Name="ImagesContainer" Grid.Column="2" VerticalAlignment="Center"> <Grid.ColumnDefinitions> <ColumnDefinition Width="*" /> <ColumnDefinition Width="*" /> <ColumnDefinition Width="*" /> <ColumnDefinition Width="*" /> </Grid.ColumnDefinitions> <Image x:Name="ImgImportant" Grid.Column="0" Width="20" Height="20" VerticalAlignment="Center" HorizontalAlignment="Center" Source="ms-appx:///Assets/ico_important_red.png" /> <Image x:Name="ImgFolders" Grid.Column="1" Width="20" Height="20" VerticalAlignment="Center" HorizontalAlignment="Center" Source="ms-appx:///Assets/ico_ico_addtofolder.png" /> <Image x:Name="ImgAttachment" Grid.Column="2" Width="20" Height="20" VerticalAlignment="Center" HorizontalAlignment="Center" Source="ms-appx:///Assets/ico_attachment_lightgray.png" /> <Image x:Name="ImgFlag" Grid.Column="3" Width="20" Height="20" VerticalAlignment="Center" HorizontalAlignment="Center" Source="ms-appx:///Assets/ico_flag.png" /> </Grid> <TextBlock x:Name="Time" Grid.Column="3" Text="{Binding EmailProperties.DateReceived, Converter={StaticResource EmailHeaderTimeConverter}}" TextAlignment="Center" FontSize="16" VerticalAlignment="Center" Margin="0" /> </Grid> <TextBlock Grid.Row="1" Text="{Binding EmailProperties.Subject}" TextTrimming="WordEllipsis" Margin="0,10" /> <TextBlock Grid.Row="2" Text="{Binding EmailProperties.Preview}" TextTrimming="WordEllipsis" /> </Grid> </Grid> The MessageSummary is a UserControl. I would like to bind the foreground color of the Items of the ListBox to whether the item is the one selected in the list box, i.e. I would like the Item's foreground color to be Black if not selected and White if the item is selected. How can it be done? Thanks,

    Read the article

  • Using XAML + designer to edit Plain Old CLR Objects?

    - by Joe White
    I want to write a POCO in XAML, and use a DataTemplate to display that object in the GUI at runtime. So far, so good; I know how to do all that. Since I'll already have a DataTemplate that can transform my POCO into a WPF visual tree, is there any way to get the Visual Studio designer to play along, and have the Design View show me the POCO+DataTemplate's resulting GUI, as I edit the POCO's XAML? (Obviously the designer wouldn't know how to edit the "design view"; I wouldn't expect the Toolbox or click-and-drag to work on the design surface. That's fine -- I just want to see a preview as I edit.) If you're curious, the POCOs in question would be level maps for a game. (At this point, I'm not planning to ship an end-user map editor, so I'll be doing all the editing myself in Visual Studio.) So the XAML isn't WPF GUI objects like Window and UserControl, but it's still not something where I would want to blindly bang out some XAML and hope for the best. I want to see what I'm doing (the GUI map) as I'm doing it. If I try to make a XAML file whose root is my map object, the designer shows "Intentionally Left Blank - The document root element is not supported by the visual designer." It does this even if I've defined a DataTemplate in App.xaml's <Application.Resources>. But I know the designer can show my POCO, when it's inside a WPF object. One possible way of accomplishing what I want would be to have a ScratchUserControl that just contains a ContentPresenter, and write my POCO XAML inside that ContentPresenter's Content property, e.g.: <UserControl ...> <ContentPresenter> <ContentPresenter.Content> <Maps:Map .../> </ContentPresenter.Content> </ContentPresenter> </UserControl> But then I would have to be sure to copy the content back out into its own file when I was done editing, which seems tedious and error-prone, and I don't like tedious and error-prone. And since I can preview my XAML this way, isn't there some way to do it without the UserControl?

    Read the article

  • Visual WebGui's XAML based programming for web developers

    - by Webgui
    While ASP.NET provides an event base approach it is completely dismissed when working with AJAX and the richness of the server is lost and replaced with JavaScript programming and couple with a very high security risk. Visual WebGui reinstates the power of the server to AJAX development and provides a statefull yet scalable, server centric architecture that provides the benefits and user productivity of AJAX with the security and developer productivity we had before AJAX stormed into our lives. "When I first came up with the concept of Visual WebGui , I was frustrated by the fragile and complex nature of developing web applications. The contrast in productivity between working in a fully OOP compiled environment vs. scripting even today, with JQuery, Dojo and such, is still huge. Even today the greatest sponsor of JavaScript programming, Google, is offering a framework to avoid JavaScript using Java that compiles to JavaScript (GWT). So I decided to find a way to abstract the complexity or rather delegate the complex job to enable developers to concentrate on the “What” instead of the “How” and embraced the Form based approach," said Guy Peled the inventor of Visual WebGui. Although traditional OOP development still rules the enterprise, the differences between web sites and web applications have blurred and so did the differences between classic developers and web developers. As a result, we now see declarative languages in desktop / backend development environments (WPF / WF) and we see OOP, gaining more and more power in web development (ASP.NET MVC / ASP.NET DOM). However, what has not changed is enterprise need for security, development ROI, reach, highly responsive and interactive UIs and scalability. The advantages that declarative languages and 'on demand' compilation provide over classic development are mostly the flexibility and a more readable initialize component it offers which is what Gizmox is aspiring to do by replacing the designer initialize component with XAML code. The code in this new project template will be compiled on demand using the build provider mechanism ASP.NET has. This means that the performance hit is only on the first request and after that the performance is the same as a prebuilt solution. This will allow the flexibility of a dynamically updated sites and the power of fully blown enterprise applications over web. You can also use prebuilt features available in ASP.NET to enjoy both worlds in production. VWG XAML implementation (VWG Sites) will be the first truly compliable XAML implementation as Microsoft implemented Silverlight and WPF as a runtime markup interpretation opposed to the ASP.NET markup implementation which is compiled to CLR code once. We have chosen to implement the VWG Sites parser as a different way to create CLR code that provides greater performance over the reflection alternative. VWG Sites will also be the first server side XAML UI engine which, while giving the power of XAML, it will not require any plug-ins or installations on the client side. Short demo video of VWG Sites markup. There is also a live sample available here.

    Read the article

  • BUILD 2013 Session&ndash;What&rsquo;s New In XAML

    - by Tim Murphy
    Originally posted on: http://geekswithblogs.net/tmurphy/archive/2013/06/27/build-2013-sessionndashwhatrsquos-new-in-xaml.aspx If ever there was a session that you felt like your head was going to explode, this one would do it.  Tim Heuer proceeded to try to fit as many of the changes and additions to XAML as he could in one hour. There were a number of improvements that struck me.  The first was the fact that we no longer need to put stack panels in the AppBar in order to add buttons.  This has been changed to a CommandBar which at the very least makes the markup read more cleanly.  Now if they would just bring this same improvement to Windows Phone we would be set. There was a lot of cheering at the beginning of his talk when he showed that there are now date time pickers.  I understand that it makes life easier, but I just couldn’t get that excited. The couple of features that did grab my attention being able to select a group of tags and then add an encapsulating tag such as a StackPanel around them and the fact that they have optimized XAML so that now runs on average 25% faster. I’d go crazy trying to list off all the improvements and new features so be sure to go and review the recording of the session. del.icio.us Tags: BUILD 2013,XAML,Windows 8.1

    Read the article

  • How to work with XAML editor in Visual Studio 2010?

    - by MartyIX
    I've worked with Visual Studio 2008 and editing XAML was really painful because the designer reloaded very slowly. Now I have installed Visual Studio 2010 and it seems to me that the XAML editor + Designer haven't changed much. For example in order to force designer to change a color in my control I have to close the xaml file and open it again. Is it just my problem? I've tried this solution: http://stackoverflow.com/questions/859335/visual-studio-2008-xaml-editor-not-working-disappeared but it didn't help. Are there any better tools for Visual Studio to edit XAML? Thanks!

    Read the article

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