Search Results

Search found 74 results on 3 pages for 'tabitem'.

Page 2/3 | < Previous Page | 1 2 3  | Next Page >

  • How to add custom-control-derived TabItem to TabControl in WPF?

    - by orloffm
    I want to have my own base TabItem class and use other classes that derive from it. I define base class in MyNs namespace like this: public class MyCustomTab : TabItem { static MyCustomTab() { DefaultStyleKeyProperty.OverrideMetadata(typeof(MyCustomTab), new FrameworkPropertyMetadata(typeof(TabItem))); } } And this is what I do for the class that inherits from it: code-behind in MyNs namespace: public partial class ActualTab : MyCustomTab { public ActualTab() { InitializeComponent(); } } XAML: <MyCustomTab x:Class="MyNs.ActualTab" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> <Grid> </Grid> </MyCustomTab> The error I get is "The tag 'MyCustomTab' does not exist in XML namespace 'http://schemas.microsoft.com/winfx/2006/xaml/presentation'". If I use TabItem tag in XAML the error says that it's not possible to define to different base classes. How to fix this?

    Read the article

  • How to change the overlapping order of TabItems in WPF TabControl

    - by sannoble
    I have created vertical TabItems with a Path object. The selected TabItem overlaps the unselected TabItems, this works fine. The overlapping is done by setting a negative margin in the TabItem Template. For the unselected TabItems right now a TabItem is overlapped by the TabItem below. For example in the picture Tab 4 overlaps Tab 3 and Tab 3 overlaps Tab 2. I would like to change the overlapping order for the unselected Tab Items, so that an unselected TabItem overlaps the TabItem below and is overlapped by the TabItem above, e.g. Tab 2 overlaps Tab 3 and Tab 3 overlaps Tab 4. I have tried to set the FlowDirection property of TabPanel, but this doesn't work. How can I achieve this? Any help is appreciated. Thanks in advance! Wrong overlapping of unselected TabItems: XAML-Code: <Style x:Key="styleMainNavTabControl" TargetType="{x:Type TabControl}"> <Setter Property="TabStripPlacement" Value="Left" /> <Setter Property="SnapsToDevicePixels" Value="true"/> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="{x:Type TabControl}"> <Grid> <Grid.ColumnDefinitions> <ColumnDefinition Width="*" /> <ColumnDefinition Width="200"/> </Grid.ColumnDefinitions> <Border Grid.Column="0" Background="White" BorderBrush="Black" BorderThickness="0,0,1,0" Padding="20"> <ContentPresenter ContentSource="SelectedContent" /> </Border> <Border Grid.Column="1" Padding="0,30,10,0" Background="#F7F3F7"> <TabPanel Panel.ZIndex="1" Margin="-1,0,0,0" FlowDirection="RightToLeft" IsItemsHost="True" Background="Transparent"/> </Border> </Grid> </ControlTemplate> </Setter.Value> </Setter> </Style> <Style x:Key="styleMainNavTabItem" TargetType="{x:Type TabItem}"> <Setter Property="MinHeight" Value="90" /> <Setter Property="FontSize" Value="14" /> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="{x:Type TabItem}"> <Grid Margin="0,0,0,-35"> <Path Name="TabPath" Stroke="Black" StrokeThickness="1" Fill="LightGray" Data="M 0,0 a 10,10 0 0 0 10,10 h 150 a 20,20 0 0 1 20,20 v 60 a 20,20 0 0 1 -20,20 h -150 a 10,10 0 0 0 -10,10 z" /> <ContentPresenter ContentSource="Header" Margin="10,2,10,2" VerticalAlignment="Center" TextElement.Foreground="#FF000000"/> </Grid> <ControlTemplate.Triggers> <Trigger Property="IsSelected" Value="True"> <Setter Property="Panel.ZIndex" Value="100" /> <Setter TargetName="TabPath" Property="Fill" Value="White" /> <Setter TargetName="TabPath" Property="Data" Value="M 0,0 a 10,10 0 0 0 10,10 h 150 a 20,20 0 0 1 20,20 v 60 a 20,20 0 0 1 -20,20 h -150 a 10,10 0 0 0 -10,10" /> </Trigger> <Trigger Property="IsSelected" Value="False"> <Setter Property="Panel.ZIndex" Value="90" /> </Trigger> </ControlTemplate.Triggers> </ControlTemplate> </Setter.Value> </Setter>

    Read the article

  • Binding DataTemplates (or another aproach)

    - by Bataglião
    Hi all, I'm having some troubles trying to dynamically generate content in WPF and after it bind data. I have the following scenario: TabControl - Dynamically generated TabItems through DataTemplate - inside TabItems, I have dynamic content generated by DataTemplate that I wish to bind (ListBox). The code follows: ::TabControl <TabControl Height="252" HorizontalAlignment="Left" Name="tabControl1" VerticalAlignment="Top" Width="458" Margin="12,12,12,12" ContentTemplate="{StaticResource tabItemContent}"></TabControl> ::The Template for TabControl to generate TabItems <DataTemplate x:Key="tabItemContent"> <Grid> <Grid.ColumnDefinitions> <ColumnDefinition Width="*" /> </Grid.ColumnDefinitions> <Grid.RowDefinitions> <RowDefinition Height="*" /> </Grid.RowDefinitions> <ListBox ItemTemplate="{StaticResource listBoxContent}" ItemsSource="{Binding}"> </ListBox> </Grid> </DataTemplate> ::The template for ListBox Inside each TabItem <DataTemplate x:Key="listBoxContent"> <Grid> <Grid.ColumnDefinitions> <ColumnDefinition Width="22"/> <ColumnDefinition Width="*" /> </Grid.ColumnDefinitions> <Image Grid.Column="0" Source="{Binding Path=PluginIcon}" /> <TextBlock Grid.Column="1" Text="{Binding Path=Text}" /> </Grid> </DataTemplate> So, when I try to do this on code inside a loop to create the tabitems: TabItem tabitem = tabControl1.Items[catIndex] as TabItem; tabitem.DataContext = plugins.ToList(); where 'plugins' is an Enumerable The ListBox is not bounded. I tried also to find the ListBox inside the TabItem to set the ItemSource property but no success at all. Someone have an idea on how to do that? Thanks in advance.

    Read the article

  • Setting CommandTarget to selected control in a TabControl

    - by Bart
    I have a WPF window with a few buttons and a tabcontrol having a tab for each 'document' the user is working on. The tabcontrol uses a DataTemplate to render the data in ItemSource of the tabcontrol. The question: If one of the buttons is clicked, the command should be executed on the control rendering the document in the active tab, but I've no idea what I should set CommandTarget to. I tried {Binding ElementName=nameOfControlInDataTemplate} but that obviously doesn't work. I tried to make my problem a bit more abstract with the following code (no ItemSource and Document objects, but the idea is still the same). <Button Command="ApplicationCommands.Save" CommandTarget="{Binding ElementName=nestedControl}">Save</Button> <TabControl x:Name="tabControl"> <TabControl.Items> <TabItem Header="Header1">Item 1</TabItem> <TabItem Header="Header2">Item 2</TabItem> <TabItem Header="Header3">Item 3</TabItem> </TabControl.Items> <TabControl.ContentTemplate> <DataTemplate> <CommandTest:NestedControl Name="nestedControl"/> </DataTemplate> </TabControl.ContentTemplate> </TabControl> I tested the code by replacing the complete tabcontrol with only one single NestedControl, and then the command button just works. To be complete, here is the code of NestedControl: <UserControl x:Class="CommandTest.NestedControl" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> <Grid> <Label x:Name="label" Content="Not saved"/> </Grid> </UserControl> And code behind: public partial class NestedControl : UserControl { public NestedControl() { CommandBindings.Add(new CommandBinding(ApplicationCommands.Save, CommandBinding_Executed)); InitializeComponent(); } private void CommandBinding_Executed(object sender, ExecutedRoutedEventArgs e) { label.Content = "Saved"; } }

    Read the article

  • WPF Customized TabControl

    - by xsl
    I have to develop a customized tab control and decided to create it with WPF/XAML, because I planned to learn it anyway. It should look like this when it's finished: I made good progress so far, but there are two issues left: Only the first/last tab item should have a rounded upper-left/bottom-left corner. Is it possible to modify the style of these items, similar to the way I did with the selected tab item? The selected tab item should not have a border on its right side. I tried to accomplish this with z-index and overlapping, but the results were rather disappointing. Is there any other way to do this? XAML: <Window x:Class="MyProject.TestWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="TestWindow" Height="350" Width="500" Margin="5" Background="LightGray"> <Window.Resources> <Style TargetType="{x:Type TabControl}"> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="{x:Type TabControl}"> <DockPanel> <Border Margin="0,100,-1,0" Background="#FFAAAAAA" BorderBrush="Gray" CornerRadius="7,0,0,7" BorderThickness="1"> <TabPanel Margin="0,0,0,0" IsItemsHost="True" /> </Border> <Border Background="WhiteSmoke" BorderBrush="Gray" BorderThickness="1" CornerRadius="7,7,7,0" > <ContentPresenter ContentSource="SelectedContent" /> </Border> </DockPanel> </ControlTemplate> </Setter.Value> </Setter> </Style> <Style TargetType="{x:Type TabItem}"> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="{x:Type TabItem}"> <Grid> <Border Name="Border" Background="#FFAAAAAA" CornerRadius="7,0,0,0" BorderBrush="Gray" BorderThickness="0,0,0,1" Margin="0,0,0,0"> <ContentPresenter x:Name="ContentSite" VerticalAlignment="Center" HorizontalAlignment="Left" ContentSource="Header" Margin="10,10,10,10"/> </Border> </Grid> <ControlTemplate.Triggers> <Trigger Property="IsSelected" Value="True"> <Setter TargetName="Border" Property="Background" Value="WhiteSmoke" /> </Trigger> </ControlTemplate.Triggers> </ControlTemplate> </Setter.Value> </Setter> </Style> </Window.Resources> <Grid> <TabControl Name="_menuTabControl" TabStripPlacement="Left" Margin="5"> <TabItem Name="_tabItem1" Header="First Tab Item" ></TabItem> <TabItem Name="_tabItem2" Header="Second Tab Item" > <Grid /> </TabItem> <TabItem Name="_tabItem3" Header="Third Tab Item" > <Grid /> </TabItem> </TabControl> </Grid>

    Read the article

  • WPF TabControl - how to preserve control state within tab items (MVVM pattern)

    - by Tim Coulter
    I am a newcomer to WPF, attempting to build a project that follows the recommendations of Josh Smith's excellent article describing The Model-View-ViewModel Design Pattern. Using Josh's sample code as a base, I have created a simple application that contains a number of "workspaces", each represented by a tab in a TabControl. In my application, a workspace is a document editor that allows a hierarchical document to be manipulated via a TreeView control. Although I have succeeded in opening multiple workspaces and viewing their document content in the bound TreeView control, I find that the TreeView "forgets" its state when switching between tabs. For example, if the TreeView in Tab1 is partially expanded, it will be shown as fully collapsed after switching to Tab2 and returning to Tab1. This behaviour appears to apply to all aspects of control state for all controls. After some experimentation, I have realized that I can preserve state within a TabItem by explicitly binding each control state property to a dedicated property on the underlying ViewModel. However, this seems like a lot of additional work, when I simply want all my controls to remember their state when switching between workspaces. I assume I am missing something simple, but I am not sure where to look for the answer. Any guidance would be much appreciated. Thanks, Tim Update: As requested, I will attempt to post some code that demonstrates this problem. However, since the data that underlies the TreeView is complex, I will post a simplified example that exhibits the same symtoms. Here is the XAML from the main window: <TabControl IsSynchronizedWithCurrentItem="True" ItemsSource="{Binding Path=Docs}"> <TabControl.ItemTemplate> <DataTemplate> <ContentPresenter Content="{Binding Path=Name}" /> </DataTemplate> </TabControl.ItemTemplate> <TabControl.ContentTemplate> <DataTemplate> <view:DocumentView /> </DataTemplate> </TabControl.ContentTemplate> </TabControl> The above XAML correctly binds to an ObservableCollection of DocumentViewModel, whereby each member is presented via a DocumentView. For the simplicity of this example, I have removed the TreeView (mentioned above) from the DocumentView and replaced it with a TabControl containing 3 fixed tabs: <TabControl> <TabItem Header="A" /> <TabItem Header="B" /> <TabItem Header="C" /> </TabControl> In this scenario, there is no binding between the DocumentView and the DocumentViewModel. When the code is run, the inner TabControl is unable to remember its selection when the outer TabControl is switched. However, if I explicitly bind the inner TabControl's SelectedIndex property ... <TabControl SelectedIndex="{Binding Path=SelectedDocumentIndex}"> <TabItem Header="A" /> <TabItem Header="B" /> <TabItem Header="C" /> </TabControl> ... to a corresponding dummy property on the DocumentViewModel ... public int SelecteDocumentIndex { get; set; } ... the inner tab is able to remember its selection. I understand that I can effectively solve my problem by applying this technique to every visual property of every control, but I am hoping there is a more elegant solution.

    Read the article

  • iPhone SDK - UITabBarConroller and custom design

    - by Cheryl
    Hi I am having a problem with my tab bars at the bottom of the screen. The designer has decided it should be one colour (not black) when inactive and another colour when active. I have worked out how to replace the main colour of the tabbar by subclassing UITabBarController and doing this:- - (void)viewDidLoad { [super viewDidLoad]; CGRect frame = CGRectMake(0.0, 0, self.view.bounds.size.width, self.view.bounds.size.height); UIView *v = [[UIView alloc] initWithFrame:frame]; //get percentage values from digitalcolour meter and enter as decimals v.backgroundColor = [UIColor colorWithRed:.0 green:.706 blue:.863 alpha:1]; [tabBar1 insertSubview:v atIndex:0]; [v release]; } I just can't see how to make the active tabbar be a separate colour when it is selected. I have tried subclassing UITabBarItem but there doesn't seem to be any property for me to set to change the background colour of the tab. They also want to have the icons on the tab bar not be blue and grey and I can't figure out how to do that. In the ViewController for one tab bar item I have put this into viewdidload:- myTabBarItem *tabItem = [[myTabBarItem alloc] initWithTitle:@"listOOO" image:[UIImage imageNamed:@"starcopy.png"] tag:1]; tabItem.customHighlightedImage=[UIImage imageNamed:@"starcopy.png"]; self.tabBarItem=tabItem; [tabItem release]; tabItem=nil; and in my subclass of UITabBarItem I have put this:- -(UIImage *) selectedImage{ return self.customHighlightedImage; } Only I don't see the icon at all. If I put this into the viewDidLoad of my subclass of UITabBarController:- for (UITabBarItem *item in tabBar1.items){ item.image = [UIImage imageNamed:@"starcopy.png"]; } Then all my tab bars have the icon but they are blue (and grey when inactive) how would I get them not to become blue but stay their original colour? If you have any light on this problem please help as I have been banking my head on the wall for 2 days now and it's getting me down. Thanks in advance Cheryl

    Read the article

  • Keyboard navigation in typical WPF Business Line Application

    - by Guge
    I have a WPF business line application with a tabbed userinterface, menus and toolbars. The application must be navigable through a keyboard, some users like to minimize mouse use. I have thrown together the included XAML sample to illustrate the problem of keyboard navigation. Using the tab key I can only get to the menu, and then to the toolbar. I have tried various attached properties for KeyboardNavigation and FocusManager, but I have not succeeded in the following goals: Navigate to the contents of the first tabpage using the keyboard. Disable tab key navigation from tabpage to menu and toolbar. Change tabpage using Ctrl-Tab. <Window x:Class="WpfApplication4.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="MainWindow" Height="408" Width="569" > <DockPanel> <Menu DockPanel.Dock="Top"> <MenuItem Header="_File"> <MenuItem Header="Open"/> </MenuItem> <MenuItem Header="_Edit"></MenuItem> </Menu> <ToolBarTray DockPanel.Dock="Top"> <ToolBar> <Label Target="{Binding ElementName=SearchBox}"> _Search </Label> <TextBox Name="SearchBox" Width="80"></TextBox> <Button>Search</Button> </ToolBar> </ToolBarTray> <StatusBar DockPanel.Dock="Bottom"> Statusbar here </StatusBar> <TabControl> <TabItem Header="File 1"> <WrapPanel> <Button>Click</Button> <CheckBox>Check</CheckBox> <Slider Minimum="0" Maximum="100" Width="150"/> </WrapPanel> </TabItem> <TabItem Header="File 2"> </TabItem> <TabItem Header="File 3"> </TabItem> </TabControl> </DockPanel>

    Read the article

  • WPF Issues with Control Layout

    - by Brett Powell
    I am making an application that connects to our billing software using its API, and I am running into a few issues getting the layout working properly. I want to make it so that when one of the expanders is minimized, the other window fills the gap, and when it is expanded again the other expander goes back to where it was. Right now when the arrow is clicked on one, there is just an empty gap. I used a DockPanel as the parent which I assumed would automatically do this, but it isn't working. Second question, is there a way to make these areas resizable? I don't want to try and get too frisky with allowing the user to undock the menus (don't even know if that is possible with just straight WPF) but it would be nice if they could change the width/height of them. Also, just a newbie question to C#, but what is the equivalent of a C++ header file? It looks like you just use .cs files, but I am not sure. I want to extract all of my functions that pull the data from the billing software and put them into a different file to clean up the code. Here is my XAML... <Window x:Class="WpfApplication3.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="Billing Management" Height="550" Width="754" xmlns:shared="http://schemas.actiprosoftware.com/winfx/xaml/shared" WindowStartupLocation="CenterScreen" WindowStyle="ThreeDBorderWindow"> <Grid> <Grid.RowDefinitions> <RowDefinition Height="22" /> <RowDefinition /> </Grid.RowDefinitions> <Menu Height="22" Name="menu1" Margin="0" HorizontalAlignment="Stretch" VerticalAlignment="Top" HorizontalContentAlignment="Left" IsEnabled="True" IsMainMenu="True"> <MenuItem Header="_File"> <MenuItem Header="_Open" /> <MenuItem Header="_Close" /> <Separator/> <MenuItem Header="_Exit" /> </MenuItem> </Menu> <TabControl Name="tabControl1" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch" BorderThickness="1" Padding="0" TabStripPlacement="Bottom" UseLayoutRounding="False" FlowDirection="LeftToRight" Grid.Row="1"> <TabItem Header="Main" Name="tabItem1" Margin="0"> <DockPanel Name="dockPanel1" LastChildFill="True"> <ListBox Height="100" Name="listBox3" DockPanel.Dock="Top" /> <ListBox Name="listBox4" Width="200" DockPanel.Dock="Right" /> <DockPanel Height="Auto" Name="dockPanel2" Width="Auto" VerticalAlignment="Stretch" LastChildFill="True"> <shared:AnimatedExpander Header="Staff Online" Width="200" Name="expanderStaffOnline" IsExpanded="True" Height="194" BorderThickness="0" DockPanel.Dock="Top" VerticalContentAlignment="Stretch"> <ListBox Name="listboxStaffOnline" Width="Auto" Height="Auto" Margin="0" VerticalAlignment="Stretch" Loaded="listboxStaffOnline_Loaded" /> </shared:AnimatedExpander> <shared:AnimatedExpander Header="Test Menu 2" Height="Auto" Name="animatedExpander1" BorderThickness="1" Margin="0,0,0,0" IsExpanded="True" VerticalContentAlignment="Stretch"> <ListBox Height="Auto" HorizontalAlignment="Stretch" Name="listBox6" VerticalAlignment="Stretch" Margin="0" BorderThickness="1" /> </shared:AnimatedExpander> </DockPanel> <ListBox Height="100" Name="listboxAdminLogs" DockPanel.Dock="Bottom" Loaded="listboxAdminLogs_Loaded" /> <ListBox Name="listBox5" /> </DockPanel> </TabItem> <TabItem Header="Support" Name="tabItem2" Margin="0"> </TabItem> <TabItem Header="Clients" /> <TabItem Header="Billing" /> <TabItem Header="Orders" /> </TabControl> </Grid> </Window>

    Read the article

  • WPF C# Hide TabControl Items on Application Startup

    - by mr justinator
    I've created a start page that loads when the application is run but it is also showing my tabcontrol (two tabitems for editing & diagraming). How do I hide my tabcontrol items on startup and only show it when a user selects file - new? Many thanks! Xaml: <TabControl Height="Auto" Name="tabControl1" Width="Auto"> <TabItem Header="Diagram" Name="DiagramTab"></TabItem> <TabItem Header="Rulebase" Name="RuleTab" > <Grid> <TextBox Height="Auto" Name="RuleText" Width="Auto" Text="" AcceptsTab="True" AcceptsReturn="True" VerticalScrollBarVisibility="Auto" GotFocus="FocusChanged" KeyDown="ContentChanged" HorizontalScrollBarVisibility="Visible" /> </Grid> </TabItem> </TabControl> Here's my file - new menu item: private void ProcessNewCommand() { if (dataChanged) { string sf = SaveFirst(); if (sf != "Cancel") { ClearState(); } } else { ClearState(); } }

    Read the article

  • How to refresh the textbox text when tabs are Changed in WPF

    - by StonedJesus
    Well in my WPF application I am using Tab Control which has around 5 tabs. The view of each tab is a user control which I add via a tool box. Main Xaml File: <Grid> <TabControl Height="Auto" HorizontalAlignment="Stretch" Margin="0" Name="tabControl1" VerticalAlignment="Stretch" Width="Auto"> <TabItem Header="Device Control" Name="Connect"> <ScrollViewer Height="Auto" Name="scrollViewer1" Width="Auto"> <my:ConnectView Name="connectView1" /> </ScrollViewer> </TabItem> <TabItem Header="I2C"> <ScrollViewer Height="Auto" Name="scrollViewer2" Width="Auto"> <my1:I2CControlView Name="i2CControlView1" /> </ScrollViewer> </TabItem> <TabItem Header="Voltage"> <ScrollViewer Height="Auto" Name="scrollViewer3" Width="Auto"> <my2:VoltageView Name="voltageView1" /> </ScrollViewer> </TabItem> </TabControl> </Grid> If you notice each view ie.e Connect, I2C and Voltage is a user control which has a view, viewmodel and model class :) Each of these views have set of textboxes in their respective xaml files. Connect.xaml: <Grid> <Textbox Text="{Binding Box}", Name="hello" /> // Some more textboxes </Grid> I2c.xaml: <Grid> <Textbox Text="{Binding I2CBox}", Name="helI2c" /> // Some more textboxes </Grid> Voltage.xaml: <Grid> <Textbox Text="{Binding VoltBox}", Name="heVoltllo" /> // Some more textboxes </Grid>** By default I have set the text of these textboxes to some value. Lets say "12" "13" "14" respectively in my view model classes. My main requirement is to set the text of these textboxes present in each user control to get refreshed when I change the tab. Description: Lets say Connect View is displayed: Value of Textbox is 12 and I edit it and change it to 16. Now I click on I2C tab and then I go back to Connect tab, I want the textbox value to get refreshed back to the initial value i.e. 12. To be precise, is their a method called visibilitychanged() which I can write in all my user control classes, where I can set the value of these Ui components whenever tabs are changed? Please help :)

    Read the article

  • Adding Volcanos and Options - Earthquake Locator, part 2

    - by Bobby Diaz
    Since volcanos are often associated with earthquakes, and vice versa, I decided to show recent volcanic activity on the Earthquake Locator map.  I am pulling the data from a website created for a joint project between the Smithsonian's Global Volcanism Program and the US Geological Survey's Volcano Hazards Program, found here.  They provide a Weekly Volcanic Activity Report as an RSS feed.   I started implementing this new functionality by creating a new Volcano entity in the domain model and adding the following to the EarthquakeService class (I also factored out the common reading/parsing helper methods to a separate FeedReader class that can be used by multiple domain service classes):           private static readonly string VolcanoFeedUrl =             ConfigurationManager.AppSettings["VolcanoFeedUrl"];           /// <summary>         /// Gets the volcano data for the previous week.         /// </summary>         /// <returns>A queryable collection of <see cref="Volcano"/> objects.</returns>         public IQueryable<Volcano> GetVolcanos()         {             var feed = FeedReader.Load(VolcanoFeedUrl);             var list = new List<Volcano>();               if ( feed != null )             {                 foreach ( var item in feed.Items )                 {                     var quake = CreateVolcano(item);                     if ( quake != null )                     {                         list.Add(quake);                     }                 }             }               return list.AsQueryable();         }           /// <summary>         /// Creates a <see cref="Volcano"/> object for each item in the RSS feed.         /// </summary>         /// <param name="item">The RSS item.</param>         /// <returns></returns>         private Volcano CreateVolcano(SyndicationItem item)         {             Volcano volcano = null;             string title = item.Title.Text;             string desc = item.Summary.Text;             double? latitude = null;             double? longitude = null;               FeedReader.GetGeoRssPoint(item, out latitude, out longitude);               if ( !String.IsNullOrEmpty(title) )             {                 title = title.Substring(0, title.IndexOf('-'));             }             if ( !String.IsNullOrEmpty(desc) )             {                 desc = String.Join("\n\n", desc                         .Replace("<p>", "")                         .Split(                             new string[] { "</p>" },                             StringSplitOptions.RemoveEmptyEntries)                         .Select(s => s.Trim())                         .ToArray())                         .Trim();             }               if ( latitude != null && longitude != null )             {                 volcano = new Volcano()                 {                     Id = item.Id,                     Title = title,                     Description = desc,                     Url = item.Links.Select(l => l.Uri.OriginalString).FirstOrDefault(),                     Latitude = latitude.GetValueOrDefault(),                     Longitude = longitude.GetValueOrDefault()                 };             }               return volcano;         } I then added the corresponding LoadVolcanos() method and Volcanos collection to the EarthquakeViewModel class in much the same way I did with the Earthquakes in my previous article in this series. Now that I am starting to add more information to the map, I wanted to give the user some options as to what is displayed and allowing them to choose what gets turned off.  I have updated the MainPage.xaml to look like this:   <UserControl x:Class="EarthquakeLocator.MainPage"     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:basic="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls"     xmlns:bing="clr-namespace:Microsoft.Maps.MapControl;assembly=Microsoft.Maps.MapControl"     xmlns:vm="clr-namespace:EarthquakeLocator.ViewModel"     mc:Ignorable="d" d:DesignWidth="640" d:DesignHeight="480" >     <UserControl.Resources>         <DataTemplate x:Key="EarthquakeTemplate">             <Ellipse Fill="Red" Stroke="Black" StrokeThickness="1"                      Width="{Binding Size}" Height="{Binding Size}"                      bing:MapLayer.Position="{Binding Location}"                      bing:MapLayer.PositionOrigin="Center">                 <ToolTipService.ToolTip>                     <StackPanel>                         <TextBlock Text="{Binding Title}" FontSize="14" FontWeight="Bold" />                         <TextBlock Text="{Binding UtcTime}" />                         <TextBlock Text="{Binding LocalTime}" />                         <TextBlock Text="{Binding DepthDesc}" />                     </StackPanel>                 </ToolTipService.ToolTip>             </Ellipse>         </DataTemplate>           <DataTemplate x:Key="VolcanoTemplate">             <Polygon Fill="Gold" Stroke="Black" StrokeThickness="1" Points="0,10 5,0 10,10"                      bing:MapLayer.Position="{Binding Location}"                      bing:MapLayer.PositionOrigin="Center"                      MouseLeftButtonUp="Volcano_MouseLeftButtonUp">                 <ToolTipService.ToolTip>                     <StackPanel>                         <TextBlock Text="{Binding Title}" FontSize="14" FontWeight="Bold" />                         <TextBlock Text="Click icon for more information..." />                     </StackPanel>                 </ToolTipService.ToolTip>             </Polygon>         </DataTemplate>     </UserControl.Resources>       <UserControl.DataContext>         <vm:EarthquakeViewModel AutoLoadData="True" />     </UserControl.DataContext>       <Grid x:Name="LayoutRoot">           <bing:Map x:Name="map" CredentialsProvider="--Your-Bing-Maps-Key--"                   Center="{Binding MapCenter, Mode=TwoWay}"                   ZoomLevel="{Binding ZoomLevel, Mode=TwoWay}">               <bing:MapItemsControl ItemsSource="{Binding Earthquakes}"                                   ItemTemplate="{StaticResource EarthquakeTemplate}" />               <bing:MapItemsControl ItemsSource="{Binding Volcanos}"                                   ItemTemplate="{StaticResource VolcanoTemplate}" />         </bing:Map>           <basic:TabControl x:Name="tabs" VerticalAlignment="Bottom" MaxHeight="25" Opacity="0.7">             <basic:TabItem Margin="90,0,-90,0" MouseLeftButtonUp="TabItem_MouseLeftButtonUp">                 <basic:TabItem.Header>                     <TextBlock x:Name="txtHeader" Text="Options"                                FontSize="13" FontWeight="Bold" />                 </basic:TabItem.Header>                   <StackPanel Orientation="Horizontal">                     <TextBlock Text="Earthquakes:" FontWeight="Bold" Margin="3" />                     <StackPanel Margin="3">                         <CheckBox Content=" &lt; 4.0"                                   IsChecked="{Binding ShowLt4, Mode=TwoWay}" />                         <CheckBox Content="4.0 - 4.9"                                   IsChecked="{Binding Show4s, Mode=TwoWay}" />                         <CheckBox Content="5.0 - 5.9"                                   IsChecked="{Binding Show5s, Mode=TwoWay}" />                     </StackPanel>                       <StackPanel Margin="10,3,3,3">                         <CheckBox Content="6.0 - 6.9"                                   IsChecked="{Binding Show6s, Mode=TwoWay}" />                         <CheckBox Content="7.0 - 7.9"                                   IsChecked="{Binding Show7s, Mode=TwoWay}" />                         <CheckBox Content="8.0 +"                                   IsChecked="{Binding ShowGe8, Mode=TwoWay}" />                     </StackPanel>                       <TextBlock Text="Other:" FontWeight="Bold" Margin="50,3,3,3" />                     <StackPanel Margin="3">                         <CheckBox Content="Volcanos"                                   IsChecked="{Binding ShowVolcanos, Mode=TwoWay}" />                     </StackPanel>                 </StackPanel>               </basic:TabItem>         </basic:TabControl>       </Grid> </UserControl> Notice that I added a VolcanoTemplate that uses a triangle-shaped Polygon to represent the Volcano locations, and I also added a second <bing:MapItemsControl /> tag to the map to bind to the Volcanos collection.  The TabControl found below the map houses the options panel that will present the user with several checkboxes so they can filter the different points based on type and other properties (i.e. Magnitude).  Initially, the TabItem is collapsed to reduce it's footprint, but the screen shot below shows the options panel expanded to reveal the available settings:     I have updated the Source Code and Live Demo to include these new features.   Happy Mapping!

    Read the article

  • jQuery addClass to a tag problem

    - by lander
    I have this in my html code: <ul id="navlist" <li id="tabItem1"><a href="#">Item one</a></li> <li id="tabItem2"><a href="#">Item two</a></li> <li id="tabItem3"><a href="#">Item three</a></li> <li id="tabItem4"><a href="#">Item four</a></li> </ul> I want to add a class to the a element with jquery like this: (its not working) var currentTab = 1; $(document).ready(function() { $("li#tabItem" + currentTab + ":has(a)").addClass("navlistHover"); //console.log("li#tabItem" + currentTab + ":has(a)"); }); When a delete the a element and do it like the next example, than there is no problem. $("li#tabItem" + currentTab).addClass("navlistHover");

    Read the article

  • Using MEF to build a tabbed application dynamically

    - by Mmarquee
    I'm rather taken with MEF and plan to use it to build a demo application to load different tabs. I am a begineer at MEF and WPF and although MEF is loading the assemblies I'm stuck at loading the controls into the TabItem I have created. My code looks a bt like this .. foreach (var page in pages) { TabItem item = new TabItem(); item.Header = page.PageTitle; /// Errm??? // Add each page tcPageControl.Items.Add(item); } The tabs are Pages, so I might be doing it totally wrong, and any help would be appreciated. Thanks in advance

    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

  • WPF: Set style on immediate children only

    - by ollifant
    In my application I have a tab control which has several tab items. The problem is that I want to apply a style to these tab items, but to no other (nested) tab items. I have tried setting the following style on the tab control, but this also effects all children: <Style x:Key="tabControlStyle" TargetType="{x:Type TabControl}"> <Setter Property="TabItem.Template" Value="{StaticResource tabItemTemplate}" /> </Style> By using the code above I get the following error: 'TabItem' ControlTemplate TargetType does not match templated type 'TabControl', as TabItem and TabControl have the same DependencyProperty "Template", and the code tries to set the TabItemTemplate as TabControl- Template. Can anybody help me?

    Read the article

  • WPF - ListView within listView Scrollbar problem

    - by Josh
    So I currently have a ListView "List A" who's items each have an expander control which contains another ListView "List B". The problem I am having is that sometimes List B grows so big that it extends beyond the range of List A's view area. List A's scroll bars do not pick up the fact that parts of List B are not being displayed. Is there a way to setup my xaml so that the scroll bars for List A will detect when the list inside the expander is longer then the viewing area of List A. Here is the section of code I need to modify: <TabItem Header="Finished"> <TabItem.Resources> <ResourceDictionary> <DataTemplate x:Key="EpisodeItem"> <DockPanel Margin="30,3"> <TextBlock Text="{Binding Title}" DockPanel.Dock="Left" /> <WrapPanel Margin="10,0" DockPanel.Dock="Right"> <TextBlock Text="Finished at: " /> <TextBlock Text="{Binding TimeAdded}" /> </WrapPanel> </DockPanel> </DataTemplate> <DataTemplate x:Key="AnimeItem"> <DockPanel Margin="5,10"> <Image Height="75" Width="Auto" Source="{Binding ImagePath}" DockPanel.Dock="Left" VerticalAlignment="Top"/> <Expander Template="{StaticResource AnimeExpanderControlTemplate}" > <Expander.Header> <TextBlock FontWeight="Bold" Text="{Binding AnimeTitle}" /> </Expander.Header> <ListView ItemsSource="{Binding Episodes}" ItemTemplate="{StaticResource EpisodeItem}" BorderThickness="0,0,0,0" /> </Expander> </DockPanel> </DataTemplate> </ResourceDictionary> </TabItem.Resources> <ListView Name="finishedView" ItemsSource="{Binding UploadedAnime, diagnostics:PresentationTraceSources.TraceLevel=High}" ItemTemplate="{StaticResource AnimeItem}" /> </TabItem> List A is the ListView with name "finishedView" and List B is the ListView with ItemSource "Episodes"

    Read the article

  • Multiple objects in list, C#

    - by anon
    I'm looking for something similar to List<T>, that would allow me to have multiple T. For example: List<TabItem, DataGrid, int, string, ...> = new List<TabItem, DataGrid, int, string, ...>().

    Read the article

  • How to automatically extend the tab control as items are added to it without creating a scroll bar?

    - by MICHELINE
    I am using a WPF user control (tab control) to add tab items dynamically in the simplified code below: .... foreach (string id in ids) { TabControl.Items.Add(CreateTabItem(id)); } private TabItem CreateTabItem(string name) { StackPanel txtBlock = new TextBlock(); txtblock.Text = name; txtBlock.HorizontalAlignment = Horizontalalignment.Center; panel.Children.Add(txtBlock); TabItem item = new TabItem(); item.Header = panel; <SomeControl> control = new <SomeControl>(); item.Content = control; return item; } In the xaml file I specified the following to stack all my tab items to the left column: MinWidth="100" MinHeight="300" TabStripPlacement="Left" How do I make my tab control automatically extending (ie. stretching) its height to show all the tab items as I add them in? For now, I have to manually extend the height of the display window to see all the tab items. Your insights/tips are greatly appreciated. PS: if you know how to make the vertical scroll bar appears (without adding scroll bar to my control) as soon as the tab items exceed the window height, I can settle for that if there are no answers for my original intent.

    Read the article

  • Defining InputBindings within a Style

    - by Brent
    I'm creating a WPF app using the MVVM design pattern, and I'm trying to extend the TabItem control so that it closes the tab when the user clicks the middle mouse button. I'm trying to achieve this using InputBindings, and it works very well until I try to define it within a style. I've learned that you cannot add InputBindings to a style unless you attach it using a DependencyProperty. So I followed this similar post here... and it works... almost. I can close one tab using the middle mouse button, but it won't work on any of the other tabs (all of the tabs are added at runtime and inherit the same style). So I need some help. Why would this only be working the first time, and not after? Obviously I could create a custom control that inherits from a TabItem and make it work, but I'd like to figure this out as I can see this being expanded in my projects. I'm no expert on DependencyProperties, so please help me out. Thanks! Style: <Style TargetType="{x:Type TabItem}"> <Setter Property="w:Attach.InputBindings"> <Setter.Value> <InputBindingCollection> <MouseBinding MouseAction="MiddleClick" Command="{Binding CloseCommand}"/> </InputBindingCollection> </Setter.Value> </Setter> ... </Style> Class public class Attach { public static readonly DependencyProperty InputBindingsProperty = DependencyProperty.RegisterAttached("InputBindings", typeof(InputBindingCollection), typeof(Attach), new FrameworkPropertyMetadata(new InputBindingCollection(), (sender, e) => { var element = sender as UIElement; if (element == null) return; element.InputBindings.Clear(); element.InputBindings.AddRange((InputBindingCollection)e.NewValue); })); public static InputBindingCollection GetInputBindings(UIElement element) { return (InputBindingCollection)element.GetValue(InputBindingsProperty); } public static void SetInputBindings(UIElement element, InputBindingCollection inputBindings) { element.SetValue(InputBindingsProperty, inputBindings); } }

    Read the article

  • Bound Command not firing on another viewModel? What Am I doing wrong?

    - by devnet247
    Hi I cannot seem to bind a command to a button.I have a treeview on the left showing Country City etc.. And I tabcontrol on the right. do I This uses 4 viewModels rootviewModel-ContinentViewModel-CountryViewModel-CityViewModel What I am building is based on http://www.codeproject.com/KB/WPF/TreeViewWithViewModel.aspx Now on one of the tabs I have a Toolbar with a button "TestButton" that I have mapped in zaml. This does not fire! The reason is not firing is because I m binding the RootViewModel but the command that is bound in zaml is in the cityViewModel. How Do I pass the datacontext from one view to the other? or how do I make the button fire. I need the command to be in the cityViewModel. Any Suggestions on how I bind it? View "WorldExplorerView" where I bind the main DataContext public partial class WorldExplorerView { public WorldExplorerView() { InitializeComponent(); var continents = Database.GetContinents(); var rootViewModel = new RootViewModel(continents); DataContext = rootViewModel; } } CityViewModel public class CityViewModel : TreeViewItemViewModel { private City _city; private RelayCommand _testCommand; public CityViewModel(City city, CountryViewModel countryViewModel):base(countryViewModel,false) { _city = city; } Properties etc...... public ICommand TestCommand { get { if(_testCommand==null) { _testCommand = new RelayCommand(param => GetTestCommand(), param => CanCallTestCommand); ; } return _testCommand; } } protected bool CanCallTestCommand { get { return true; } } private static void GetTestCommand() { MessageBox.Show("It works"); } } ZAML <DockPanel> <DockPanel LastChildFill="True"> <Label DockPanel.Dock="top" Content="Title " HorizontalAlignment="Center"></Label> <StatusBar DockPanel.Dock="Bottom"> <StatusBarItem Content="Status Bar" ></StatusBarItem> </StatusBar> <Grid DockPanel.Dock="Top"> <Grid.ColumnDefinitions> <ColumnDefinition/> <ColumnDefinition Width="Auto"/> <ColumnDefinition Width="2*"/> </Grid.ColumnDefinitions> <TreeView Name="tree" ItemsSource="{Binding Continents}"> <TreeView.ItemContainerStyle> <Style TargetType="{x:Type TreeViewItem}"> <Setter Property="IsExpanded" Value="{Binding IsExpanded,Mode=TwoWay}"/> <Setter Property="IsSelected" Value="{Binding IsSelected,Mode=TwoWay}"/> <Setter Property="FontWeight" Value="Normal"/> <Style.Triggers> <Trigger Property="IsSelected" Value="True"> <Setter Property="FontWeight" Value="Bold"></Setter> </Trigger> </Style.Triggers> </Style> </TreeView.ItemContainerStyle> <TreeView.Resources> <HierarchicalDataTemplate DataType="{x:Type ViewModels:ContinentViewModel}" ItemsSource="{Binding Children}"> <StackPanel Orientation="Horizontal"> <Image Width="16" Height="16" Margin="3,0" Source="Images\Continent.png"/> <TextBlock Text="{Binding ContinentName}"/> </StackPanel> </HierarchicalDataTemplate> <HierarchicalDataTemplate DataType="{x:Type ViewModels:CountryViewModel}" ItemsSource="{Binding Children}"> <StackPanel Orientation="Horizontal"> <Image Width="16" Height="16" Margin="3,0" Source="Images\Country.png"/> <TextBlock Text="{Binding CountryName}"/> </StackPanel> </HierarchicalDataTemplate> <DataTemplate DataType="{x:Type ViewModels:CityViewModel}" > <StackPanel Orientation="Horizontal"> <Image Width="16" Height="16" Margin="3,0" Source="Images\City.png"/> <TextBlock Text="{Binding CityName}"/> </StackPanel> </DataTemplate> </TreeView.Resources> </TreeView> <GridSplitter Grid.Row="0" Grid.Column="1" Background="LightGray" Width="5" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"/> <Grid Grid.Column="2" Margin="5" > <TabControl> <TabItem Header="Demo"> <DockPanel LastChildFill="True"> <ToolBar DockPanel.Dock="Top"> <!-- DOES NOT WORK--> <Button Name="btnTest" Command="{Binding TestCommand}" Content="Press me see if works"></Button> </ToolBar> <TextBox></TextBox> </DockPanel> </TabItem> <TabItem Header="Details" DataContext="{Binding Path=SelectedItem.City, ElementName=tree, Mode=OneWay}"> <StackPanel > <TextBlock VerticalAlignment="Center" FontSize="12" Text="{Binding CityName}"/> <TextBlock VerticalAlignment="Center" FontSize="12" Text="{Binding Area}"/> <TextBlock VerticalAlignment="Center" FontSize="12" Text="{Binding Population}"/> <TextBlock VerticalAlignment="Center" FontSize="12" Text="{Binding CityDetailsInfo.ClubsCount}"/> <TextBlock VerticalAlignment="Center" FontSize="12" Text="{Binding CityDetailsInfo.PubsCount}"/> </StackPanel> </TabItem> </TabControl> </Grid> </Grid> </DockPanel> </DockPanel>

    Read the article

  • Using image resource in XAML markup?

    - by Jeff Dahmer
    I'm trying to add little icons to my tabs in WPF but having trouble with how to set up the binding. <TabItem.Header> <StackPanel Orientation="Horizontal"> <Image Source="{Binding Source=prop:Resources.eye}" /> <Label VerticalAlignment="Center">Header</Label> </StackPanel> </TabItem.Header> The xmlns:prop is set up for the local project's Properties, I am pulling other values from it elsewhere so I know that the namespace works. The markup above compiles fine BUT I don't see the eye image in the tab. Also, is there any way to set this up into a template? I'm fairly new to XAML/WPF and each tab will have its own image...

    Read the article

  • how to get the region name?

    - by shemesh
    using Silverlight & Prism. i create a new scoped region inside a TabControl like so: IRegionManager regionManager = tabControl.Add(viewRegions, UNIQUEID, true); then from the TabControl SelectionChanged event i want to get the name of that region. so i go: TabItem item = e.AddedItems[0] as TabItem; FrameworkElement view = item.Content as FrameworkElement; IRegionManager xxx = RegionManager.GetRegionManager(view); so now i have the scoped region manager at hand = xxx! but how do i get its name? (the "UNIQUEID" param i have assigned to it ). HOW?

    Read the article

  • how to get TabHeader on trigger

    - by CurlyFro
    i have a tabcontrol. i'm trying to pass the tabcontrol as a parameter to figure out the selected tab item so i can get the tab header name. Binding this doesn't seem to work. ideas? <TabControl Background="#FFF9F9F9" Height="650"> <i:Interaction.Triggers> <i:EventTrigger EventName="SelectionChanged"> <n:ExecuteCommandAction Command="{Binding UpdateTabCommand}" Parameter="{Binding this}"/> </i:EventTrigger> </i:Interaction.Triggers> in my viewmodel constructor i have: _updateTabCommand = new ActionCommand< TabControl>(UpdateTab); private method: public void UpdateTab(TabControl tabControl) { var tabItem = (TabItem)tabControl.SelectedItem;

    Read the article

  • WPF: Focus in a Window and UserControl

    - by Echilon
    I'm trying to get a UserControl to tab properly and am baffled. The logical tree looks like this. |-Window -Grid -TabControl -TabItem -StackPanel -MyUserControl |-StackPanel -GroupBox -Grid -ComboBox -Textbox1 -Textbox2 Everything works fine, except when the visibility converter for the ComboBox returns Visibility.Collapsed (don't allow user to change database mode), then when textbox1 is selected, instead of being able to tab through the controls in the UserControl, the focus shifts to a button declared at the bottom of the window. Nothing else apart from the controls displayed has TabIndex or FocusManager properties set. I'm banging my head against a brick wall and I must be missing something. I've tried IsFocusScope=True/False, played with FocusedElement and nothing works if that ComboBox is invisible (Visibility.Collapsed). <Window x:Class="MyNamespace.Client.WinInstaller" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" FocusManager.FocusedElement="{Binding ElementName=tabWizard}"> <Window.Resources> <props:Settings x:Key="settings" /> </Window.Resources> <Grid Grid.IsSharedSizeScope="True"> <!-- row and column definitions omitted --> <loc:SmallHeader Grid.Row="0" x:Name="headerBranding" HeaderText="Setup" /> <TabControl x:Name="tabWizard" DataContext="{StaticResource settings}" SelectedIndex="0" FocusManager.IsFocusScope="True"> <TabItem x:Name="tbStart" Height="0"> <StackPanel> <TextBlock Text="Database Mode"/> <loc:DatabaseSelector x:Name="dbSelector" AllowChangeMode="False" TabIndex="1" AvailableDatabaseModes="SQLServer" IsPortRequired="False" DatabaseMode="{Binding Default.DbMode,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" DatabasePath="{Binding Default.DatabasePath,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"/> </StackPanel> </TabItem> ... The top of the user control is below: <UserControl x:Class="MyNamespace.Client.DatabaseSelector" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" x:Name="root" FocusManager.IsFocusScope="True" FocusManager.FocusedElement="{Binding ElementName=cboDbMode}"> <UserControl.Resources> <conv:DatabaseModeIsFileBased x:Key="DatabaseModeIsFileBased"/> <BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter"/> </UserControl.Resources> <StackPanel DataContext="{Binding}"> <GroupBox> <Grid> <!-- row and column definitions omitted --> <Label Content="Database Mode"/> <ComboBox x:Name="cboDbMode" SelectedValue="{Binding ElementName=root,Path=DatabaseMode,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" DisplayMemberPath="Value" SelectedValuePath="Key" TabIndex="1" Visibility="{Binding AllowChangeMode,ElementName=root,Converter={StaticResource BooleanToVisibilityConverter}}" /> <!-- AllowChangeMode is a DependencyProperty on the UserControl --> <Grid><!-- row and column definitions omitted --> <Label "Host"/> <TextBox x:Name="txtDBHost" Text="{Binding ElementName=root,Path=DatabaseHost,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" TabIndex="2" /> <TextBox x:Name="txtDBPort" Text="{Binding ElementName=root,Path=DatabasePortString,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" TabIndex="3" />

    Read the article

< Previous Page | 1 2 3  | Next Page >