Search Results

Search found 10936 results on 438 pages for 'wpf controls'.

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

  • Setting a theme in WPF

    - by muckdog12
    I have a relativly simple question that I can't seem to figure out. I have downloaded some theme files in an XAML format off the internet and I would like to use them as my themes in my WPF application. How do you do this? All help is appreciated!

    Read the article

  • Creating transparent background in WPF

    - by Vinjamuri
    I have a button with a backgroun image of color white. My button is sitting on the toolbar which has a bacground color of Blue. When the button is sitting on the toolbar, the button looks white, however I want it to look like blue as the the background color of toolbar is Blue. How should I achieve this in WPF.. Please let me know.

    Read the article

  • Window out of the screen when maximized using WPF shell integration library

    - by Eduardo Molteni
    I'm using the WPF Shell Integration Library to create a custom chrome of my wpf app. All is good, but when maximizing the app, 6 or 7 pixels are out of the screen. This is the code I'm using: <Style TargetType="{x:Type local:MainWindow}"> <Setter Property="shell:WindowChrome.WindowChrome"> <Setter.Value> <shell:WindowChrome ResizeBorderThickness="6" CaptionHeight="10" CornerRadius="0" GlassFrameThickness="1"/> </Setter.Value> </Setter> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="{x:Type local:MainWindow}"> <Grid> <Border BorderThickness="1" BorderBrush="#389FD1" Background="#389FD1"> <ContentPresenter Margin="0,22,0,0" Content="{TemplateBinding Content}"/> </Border> <StackPanel Orientation="Horizontal" HorizontalAlignment="Right" VerticalAlignment="Top" > <TextBlock Text="{Binding NombreUsuario}" Foreground="White" Margin="5,5,20,5" Opacity=".8" /> <Button Style="{StaticResource ImageButton}" Height="20" Width="20" Margin="0" Click="WindowMinimize" shell:WindowChrome.IsHitTestVisibleInChrome="True"> <Image Height="10" Width="10" Source="/Resources/Images/minimize.png" /> </Button> <Button Style="{StaticResource ImageButton}" Height="20" Width="20" Margin="0" Click="WindowMaximizeRestore" shell:WindowChrome.IsHitTestVisibleInChrome="True" > <Image Height="10" Width="10" Source="/Resources/Images/maximize.png" /> </Button> <Button Style="{StaticResource ImageButton}" Height="20" Width="20" Margin="0" Click="WindowClose" shell:WindowChrome.IsHitTestVisibleInChrome="True"> <Image Height="10" Width="10" Source="/Resources/Images/close.png" /> </Button> </StackPanel> </Grid> </ControlTemplate> </Setter.Value> </Setter> </Style>

    Read the article

  • LineChart in WPF

    - by Maurizio Reginelli
    I havo to implement a custom control in WPF which contains a line chart. This control should permit to an user to define, with a control template, the number of grids, the font family and the font size of axis labels and other parameters. I'm wondering if one of you can address me to an example or give me some advice. Thank you in advance.

    Read the article

  • How to set an event for all cells in WPF Datagrid

    - by Natxo
    I need OnDragEnter event for every cell on my WPF Datagrid. I tried this : <ControlTemplate TargetType="{x:Type my:DataGridCell}" x:Key="RowTemplate"> <ContentPresenter DragEnter="ContentPresenter_DragEnter" > </ContentPresenter> </ControlTemplate> But doesn't seem to work. Any ideas people?

    Read the article

  • WPF Copy / Paste functionality

    - by Wasim
    Hi all , I want to supply copy funtionality to my WPF app. I display texts in textblocks whitch comes from the server . The user cann't copy this texts and use them. How can do it ? Please you help. Thanks...

    Read the article

  • Question regarding WPF triggers

    - by Zoliq
    Hi, I have a problem with WPF triggers. In my application i used a multitrigger but would like to achieve that changes made when a trigger's conditions becomes true to persist and to be invalidated when the trigger's conditions become false. Is it possible to realize what I want ? Thanks in advance.

    Read the article

  • WPF customer control and direct content support

    - by Mmarquee
    I am fairly new to WPF, and am a bit stuck, so any help would be appreciated. I am trying to write WPF custom control that encapsulates several elements of functionality that I already having working (i.e sorting, filtering, standard menus, etc.), but in a nice neat package to avoid repetition. Anyway I have created the custom control (based on control), and then have the following in the Generic.Xaml <ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:local="clr-namespace:Controls.ListViewExtended"> <Style TargetType="{x:Type local:ListViewExtended}"> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="{x:Type local:ListViewExtended}"> <Border Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}"> <ListView> <ListView.View> <GridView> <!-- Content goes here --> </GridView> </ListView.View> </ListView> </Border> </ControlTemplate> </Setter.Value> </Setter> </Style> </ResourceDictionary> When I try to add GridViewColumns (or any control really), as below ... <elv:ListViewExtended> <GridView> <GridViewColumn Width="140" Header="Column 1" /> <GridViewColumn Width="140" Header="Column 2" /> <GridViewColumn Width="140" Header="Column 3" /> </GridView> </elv:ListViewExtended> I get the "... does not support direct content" error. I have created a dependancy property (again below) that allows the adding of GridView, but it still doesn't work. public static DependencyProperty GridViewProperty; public static string GridViewHeader(DependencyObject target) { return (string)target.GetValue(GridViewProperty); } public static void GridViewHeader(DependencyObject target, string value) { target.SetValue(GridViewProperty, value); } Thanks in advance

    Read the article

  • WPF Binding a textbox to a property of all items in a generic list

    - by muku
    Hello guys, What I want to do is simple. I have a generic list of objects. Let's say the object class contains a property named Height. What I want to do is bind a textbox's text in the UI with this list and when i change the value in the textbox then all objects in the list update their height value. I am new in WPF, I have studied the MVVM pattern, I can do simple data binding but i can't figure out how to do this :'( Thanks!

    Read the article

  • WPF binding not updating until after another action

    - by Matthew Stanford
    I have an observable collection bound to a listbox in WPF. One of the options in the window is to use an OpenFileDialog to add an item to the listbox with certain properties. When I use the OpenFileDialog it immeditaely sets two of the properties of the new item in the observable collection. I am using INotifyPropertyChanged to update the listbox. These two new properties are set correctly and now the listbox should display the title contained in the new title property and the title textbox which is bound to the listbox should display the new title as well. However, neither displays the new title upon the closing of the OpenFileDialog and when I click on another item in the listbox and come back to the item I have just changed it updates the title textbox but the title displayed in the list box is not changed until i move the item in the list box that I want to change. Here is the Binding code. ItemsSource="{Binding Path=MyData, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" And here is the implementation of the browse button that is not working (L1 being the listbox) private void browse_Click(object sender, RoutedEventArgs e) { OpenFileDialog opf = new OpenFileDialog(); opf.ShowDialog(); MyData[L1.SelectedIndex].Title = System.IO.Path.GetFileNameWithoutExtension(opf.FileName); MyData[L1.SelectedIndex].Command = opf.FileName; } When I simply type in the text boxes and click out of them it updates the list box immediately with the new information I have put in. I also have a create new button and upon clicking it, it immediately adds a new item to the list box and updates its' properties. The only one that is not updating correctly is this peice of code I have given you. Thanks for your help. EDIT: Here is my implementation of INotifyPropertyChanged private OCLB _MyData; public OCLB MyData { get { return _MyData; } set { _MyData= value; FirePropertyNotifyChanged("MyData"); } } OCLB is the obserable collection. Here is the function FirePropertyNotifyChanged public event PropertyChangedEventHandler PropertyChanged; private void FirePropertyNotifyChanged(string propertyName) { if (PropertyChanged != null) { PropertyChanged(this, new PropertyChangedEventArgs(propertyName)); } } Each of these are in the partial class MainWindow for the wpf form. I also have a class for the MyData files (with 4 get/set functions) that are stored in the OCLB(observable collection). There is also a class with functions for the OCLB.

    Read the article

  • Show Hint Tip of a truncated WPF ListBox Item

    - by vbnc141
    Hi, Been searching all over but could not find the answer I am looking for; perhaps I'm not using the correct search term. Anyways, my question is whether there is a property on the WPF ListBox control which I can set that will automatically display the full text of a truncated list item into a Hint Tip? For example, with some WinForm list-container controls, the Hint Tip only appears when the mouse is hovered over a list item that is truncated.

    Read the article

  • Changing the style of a Combo-Box in WPF (in Blend preferably)

    - by George Sealy
    I'm having some issues trying to change the look / style of a combo box in Expression Blend / WPF. While there are tutorials out there describing setting styles for buttons, there seem to be a few wrinkles with ComboBox controls. Can anyone offer any advice, or point me towards good tutorials that cover re-styling something more complex than a button?

    Read the article

  • WPF Custom Control containing a List of Objects

    - by Cecile
    Hi, I have an object Trip in my object model containing a list of Nodes (e.g. NodeName, StartDate and EndDate) and I am trying to build a Custom control in WPF that draws list of rectangles: one for each Node contained in the Trip object (based on StartDate en EndDate) Would you have any hint on how the Custom Control should be structured so that I can bind a Trip object to it and draw the rectangles properly, please?

    Read the article

  • Easy way to use Images in WPF

    - by j-t-s
    Hi All I've only just started using WPF. (I'm a WinForms guy), and from what I can see, trying to simply drag an image onto the Window is a huge PAIN. There seems to be no way where you can just select an option to tell it what picture to put indide the image control. I've seen so many sites within the last 10 minutes with atleast 10lines of code just to insert animage into a window. Is there an easier way?

    Read the article

  • Win a Free Copy of Windows Presentation Foundation 4.5 Cookbook

    - by Ricardo Peres
    Win A free copy of the 'Windows Presentation Foundation 4.5 Cookbook', just by commenting! For the contest, Packt Publishing has two eBook copies of Windows Presentation Foundation 4.5 Cookbookto be given away to two lucky winners. How you can win: To win your copy of this book, all you need to do is come up with a comment below highlighting the reason "why you would like to win this book”. Duration of the contest & selection of winners: The contest is valid for 7 days (until November 26), and is open to everyone. Winners will be selected on the basis of their comment posted. Windows Presentation Foundation 4.5 Cookbookis written by Pavel Yosifovich, the CTO of CodeValue (http://www.codevalue.net), a software development, consulting, and training company, based in Israel. This book is written in an easy-to-read style, with a strong emphasis on real-world, practical examples. Step-by-step explanations are provided for performing important tasks. This book is the best guide for C# developer who is looking forward to increase understanding and knowledge of WPF. Using this book, readers will learn to build complex and flexible user interfaces using XAML, perform lengthy operations asynchronously while keeping the UI responsive, get well-versed with WPF features such as data binding, layout, resources, templates, and styles and also customize a control’s template to alter appearance but preserve behavior. In the next days I will post my review on this book. In the meantime, here’s the table of contents: Preface Chapter 1: Foundations Chapter 2: Resources Chapter 3: Layout and Panels Chapter 4: Using Standard Controls Chapter 5: Application and Windows Chapter 6: Data Binding Chapter 7: Commands and MVVM Chapter 8: Styles, Triggers, and Control Templates Chapter 9: Graphics and Animation Chapter 10: Custom Elements Chapter 11: Threading Index I’m waiting for your comments!

    Read the article

  • WPF: change binding properties for multiple controls

    - by Catalin DICU
    I'd like that all the Text bindings for the TextBoxes in my UserControl to have UpdateSourceTrigger=PropertyChanged, and ValidatesOnDataErrors=True How to do it ? I can think of a solution: use another class for bindings (a class inheriting Binding) but maybe there is another solution, maybe using a style or template ?

    Read the article

  • Master Detail same View binding controls

    - by pipelinecache
    Hi everyone, say I have a List View with ItemControls. And a Details part that shows the selected Item from List View. Both are in the same xaml page. I tried everything to accomplish it, but what do I miss? <!-- // List --> <ItemsControl ItemsSource="{Binding Path=Model, ElementName=SomeListViewControl, Mode=Default}" SnapsToDevicePixels="True" Focusable="False" IsTabStop="False"> <ItemsControl.ItemTemplate> <DataTemplate> <SomeListView:SomeListItemControl x:Name=listItem/> </DataTemplate> </ItemsControl.ItemTemplate> </ItemsControl> <!-- // Details --> <Label Content="Begindatum" FontSize="16" VerticalAlignment="Center" Grid.Row="1" Margin="2,0,0,0"/> <TextBox x:Name="Begindatum" Grid.Column="1" Grid.Row="1" Text="{Binding Path=BeginDate, ElementName=listItem,Converter={StaticResource DateTimeConverter}, ConverterParameter=dd-MM-yyyy}" IsEnabled="False" Style="{DynamicResource TextBoxStyle}" MaxLength="30"/> public event EventHandler<DataEventArgs<SomeEntity>> OnOpenSomething; public ObservableCollection<SomeEntity> Model { get { return (ObservableCollection<SomeEntity>)GetValue(ModelProperty); } set { Model.CollectionChanged -= new NotifyCollectionChangedEventHandler(Model_CollectionChanged); SetValue(ModelProperty, value); Model.CollectionChanged += new NotifyCollectionChangedEventHandler(Model_CollectionChanged); UpdateVisualState(); } } public static readonly DependencyProperty ModelProperty = DependencyProperty.Register("Model", typeof(ObservableCollection<SomeEntity>), typeof(SomeListView), new UIPropertyMetadata(new ObservableCollection<SomeEntity>(), new PropertyChangedCallback(ChangedModel))); private static void ChangedModel(DependencyObject source, DependencyPropertyChangedEventArgs e) { SomeListView someListView = source as SomeListView; if (someListView.Model == null) { return; } CollectionView cv = (CollectionView)CollectionViewSource.GetDefaultView(someListView.Model); } private void Model_CollectionChanged(object sender, NotifyCollectionChangedEventArgs e) { if (Model == null) { return; } }

    Read the article

  • How to define a default tooltip style for all Controls

    - by skjagini
    I would like to define a style with a template when there are validation errors and would display the first error message as a tooltip. It works fine when targeting specific control like DatePicker in the following xaml. <Style TargetType="{x:Type ToolKit:DatePicker}"> <Style.Triggers> <Trigger Property="Validation.HasError" Value="true"> <Setter Property="ToolTip" Value="{Binding RelativeSource={RelativeSource Self}, Path=(Validation.Errors)[0].ErrorContent}"/> </Trigger> </Style.Triggers> </Style> I cannot get it to work for Control though, i.e. the following doesn't give any tooltip <Style TargetType="{x:Type ToolKit:Control}"> <Style.Triggers> <Trigger Property="Validation.HasError" Value="true"> <Setter Property="ToolTip" Value="{Binding RelativeSource={RelativeSource Self}, Path=(Validation.Errors)[0].ErrorContent}"/> </Trigger> </Style.Triggers> </Style> Any idea?

    Read the article

  • Inheriting System.Windows.Controls.Panel

    - by modosansreves
    I use the Panel to provide custom layout of UIElements. For this, I override MeasureOverride and ArrangeOverride. In ArrangeOverride proper locations are given to Children. In my application, there is a bunch of rather heavy (by number of visuals) children inside the panel, but only 2 of them are located inside the visible region at a time. Working with my application I feel like all the visuals are drown. I need to introduce a kind of 'virtualization' and make the children render (or take CPU cycles) selectively. How do I?

    Read the article

  • Binding ListBox to List (Collection) in XAML

    - by david2tm
    Hello, I'm learning WPF, so I'm kind of n00b in this. I saw some examples about how to do what I want to do, but nothing exactly... The question: I want to bind List to ListBox. I want to do it in XAML, w/o coding in code behind. How can I achieve that? Right now I do it that way: <!-- XAML --> <ListBox x:Name="FileList"> <ListBox.ItemTemplate> <DataTemplate> <Label Content="{Binding Path=.}"/> </DataTemplate> </ListBox.ItemTemplate> </ListBox> // Code behind public MainWindow() { // ... files = new List<string>(); FileList.ItemsSource = files; } private void FolderBrowser_TextChanged(object sender, RoutedEventArgs e) { string folder = FolderBrowser.Text; files.Clear(); files.AddRange(Directory.GetFiles(folder, "*.txt", SearchOption.AllDirectories)); FileList.Items.Refresh(); } But I want to get rid of FileList.ItemsSource = files; and FileList.Items.Refresh(); in C# code. Thanks

    Read the article

  • Can't access resource from Generic.xaml within the Custom Control constructor.

    - by myermian
    I'm not sure why this is doing this, but I can't access the resource from within my constructor. XTabItem.cs using System; using System.ComponentModel; using System.Windows; using System.Windows.Controls; using System.Windows.Media; namespace MyStuff { public class XTabItem : TabItem { public static readonly DependencyProperty XTabItemNormalBackgroundProperty; /// <summary> /// Visual Property: Normal Background /// </summary> [Description("Determines the visibility of the close button."), Category("XTabItem Visual")] public Brush XTabItemNormalBackground { get { return (Brush)GetValue(XTabItemNormalBackgroundProperty); } set { SetValue(XTabItemNormalBackgroundProperty, value); } } static XTabItem() { DefaultStyleKeyProperty.OverrideMetadata(typeof(XTabItem), new FrameworkPropertyMetadata(typeof(XTabItem))); XTabItemNormalBackgroundProperty = DependencyProperty.Register("XTabItemNormalBackground", typeof(Brush), typeof(XTabItem), new UIPropertyMetadata(null)); } public XTabItem() { //XTabItemNormalBackground = (Brush)this.TryFindResource("XTabItemNormalBackgroundBrush"); //THIS DOES NOT WORK?? } public override void OnApplyTemplate() { base.OnApplyTemplate(); } } } Generic.xaml <ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:local="clr-namespace:MyStuff" xmlns:con="clr-namespace:MyStuff.Converters" > <SolidColorBrush x:Key="XTabItemNormalBackgroundBrush" Color="BlueViolet" /> <Style TargetType="{x:Type local:XTabItem}"> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="{x:Type local:XTabItem}"> <!-- CONTENT TEMPLATE --> <Grid SnapsToDevicePixels="True"> <Border x:Name="_Border" Background="{Binding Path=XTabItemNormalBackground, RelativeSource={RelativeSource Mode=TemplatedParent}}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="1,1,1,0"> ... </Border> </Grid> </Style> </ResourceDictionary>

    Read the article

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