Search Results

Search found 9012 results on 361 pages for 'wpf binding'.

Page 90/361 | < Previous Page | 86 87 88 89 90 91 92 93 94 95 96 97  | Next Page >

  • Horrible WPF performance!

    - by Erik
    Why am i using over 80% CPU when just hovering some links? As you can see in the video i uploaded: http://www.youtube.com/watch?v=3ALF9NquTRE the CPU goes to 80% CPU when i move my mouse over the links. My style for the items are as follows <Style x:Key="LinkStyle" TargetType="{x:Type Hyperlink}"> <Style.Triggers> <Trigger Property="IsMouseOver" Value="True"> <Setter Property="Foreground" Value="White" /> </Trigger> </Style.Triggers> <Setter Property="TextBlock.TextDecorations" Value="{x:Null}" /> <Setter Property="Foreground" Value="#FFDDDDDD"/> <Setter Property="Cursor" Value="Arrow" /> </Style> Why?

    Read the article

  • WPF: How to dynamically find a usercontrol or datatemplate

    - by Elger
    I have a bunch of datatemplates I use to display various sql-views in an ItemsControl. I don't know which datatemplate i'm going to use until run-time. (every view has different columns) Next to that, I made a generic dynamic datatemplate for all those views that don't need anything special. When I display the view I want to first look in all the available datatemplates if there is one that matches, else use the default dynamic datatemplate. My question is how can I 'search' a datatemplate by name in code? Usercontrol is also possible. Thanks, Elger

    Read the article

  • Re-using Buttons in WPF

    - by Alex Marshall
    I have a bunch of different objects that are commonly edited in the same TabControl using different DataTemplates, but I want each DataTemplate to have a common look and feel with Ok and Cancel buttons at the bottom right of each tab that will close the tab or save the content and then close the currently selected tab. What's the best way to place buttons on each tab ? Is there a way to do it without copying and pasting the buttons and stack panel across all of my data templates ?

    Read the article

  • XAML C# WPF Best efficient way to do an ordered sequence of animations

    - by toni
    Hi everybody! I would like to do a sequence of animations on a label, for example, first do opacity animations from values 0 to 1 and vice versa and just at the end of opacity animation and not before a foreground animation. I would like to do it in XAML code and then start and finish de animation from C# code. Which is the best and efficient way to do it? All replies are welcome! Thanks in advance.

    Read the article

  • Issue with child of custom Decorator class in WPF

    - by galacticgrug
    I need a custom border that renders a little differently than a normal border. I made a class that inherited from Decorator as follows class BetterBorder : Decorator { protected override Size ArrangeOverride(Size arrangeSize) { return arrangeSize; } protected override void OnRender(DrawingContext dc) { //these values are calculated elsewhere dc.DrawGeometry(backgroundBrush, borderPen, pathGeometry); } } //Properties and helper methods below this All of this works fine until I try to add a child to the control, the control can be added but is not visible and seems to be moved off BetterBorders visible client area. If I inherit from Border everything works fine, what am I missing?

    Read the article

  • WPF RichTextBox with no width set

    - by Mick
    I have the following XAML code: <Window x:Class="RichText_Wrapping.Window1" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="Window1"> <Grid> <RichTextBox Height="100" Margin="2" Name="richTextBox1"> <FlowDocument> <Paragraph> This is a RichTextBox - if you don't specify a width, the text appears in a single column </Paragraph> </FlowDocument> </RichTextBox> </Grid> ... If you create this window in XAML, you can see that when you don't specify a width for the window, it wraps the text in a single column, one letter at a time. Is there something I'm missing? If it's a known deficiency in the control, is there any workaround? Thanks, Michael

    Read the article

  • WPF: How to get the event when one FrameworkElement comes in contact with other FrameworkElement

    - by Raghav
    I am developing a small application with images and trash box icon on right hand bottom. I have multiple images floating in the main window, and using mouse I can move image from one corner to other corner of window, left, right, top and bottom. I can't figure out how do I catch an event when a image touches and panel (with trash box image), in the right hand corner. Does anybody knows which event or handler to listen? This is not a drag and drop case since my images are floating so no point using drag and drop. Thank you

    Read the article

  • list box items context menu WPF

    - by Eran
    hey guys, I have list box that contains UserControl as item template the user control contains few text blocks in a grid, the thing is that I want to add context menu to my user control that will show on the list item right click but currently only right clicking the textbox inside the user control triggers the context menu appearance clicking the spaces between those textboxes triggers nothing, any idea about how can I trigger the context menu from the container list box? Thanks Eran

    Read the article

  • WPF 4, ListView and ListCollectionView custom sorting

    - by JustABill
    I'm trying to use a custom sort with a ListView, as described in this blog entry. I'm doing ListCollectionView view = (ListCollectionView)CollectionViewSource.GetDefaultView(TheList.ItemsSource); as recommended there and in several other places, but for some reason I'm getting "Unable to cast object of type 'MS.Internal.Data.EnumerableCollectionView' to type 'System.Windows.Data.ListCollectionView'." (TheList is of type ListView). What could be causing this?

    Read the article

  • Showing a tooltip on a combobox from the itemtemplate (WPF)

    - by Jamie
    I have a ComboBox with a DataTemplate. The DataTemplate has two controls, each of which has a ToolTip attached to it. The list of items of the ComboBox has the tooltips as expected when you hover over each control. But the selected item area on top of the ComboBox does not display the tooltips, though the controls are rendered as expected. Is there a way to force the tooltips to be displayed?

    Read the article

  • WPF TabControl Determine header Heigth?

    - by Petoj
    Lets say i have a reference to a TabControl is there any way to get the height of the headers? The reason for this is the following i have one tabcontrol and one image above it and i want the headers to be on the image.. so my idear was to write a value converter that can convert a tabcontrol to a Thickness.. and by using this i would be able to place the headers on top of the image...

    Read the article

  • WPF: Link from grid to form

    - by Ron H
    What I need is a grid with all employees data, and a link to a single employees form. I'm ok with filling the grid with data. my questions are: how to create the link? how to send the parameter (employeeid) to the single-employee page, and make it open with the correct data. Thanks, Ron

    Read the article

  • Multiline TextBox control in WPF

    - by Stian Karlsen
    For some reason I need the content of a TextBox to span multiple lines, and I need this to be defined directly in XAML. I know I can set TextWrapping="Wrap", and I will do that too, but what I need to do is add newlines anywhere I want in the TextBox. Can this be done in XAML? I know the following example won't work, but what I want is something like this: <TextBox>Test1 \n Test2 \n Test3</TextBox> .. and then have these displayed on three lines. Test1 Test2 Test3

    Read the article

  • WPF How to stop animation from a thread in background worker

    - by toni
    Hi! I have a task that takes a long time. I do it with a background worker thread and before start it, since Do_Work I begin an animation over a label and when task finishes, I stop it in RunWorkerCompleted but I received an error because I try to begin/stop animation in the background thread that is not the owner. How can I do this, I mean to begin/stop animation in the background worker? thanks!

    Read the article

  • WPF toolbar disappearing on resize

    - by user1122909
    On my main form I have a toolbar with a number of buttons. Once the parent form is resized down by dragging it so that the entire toolbar with all its buttons no longer fits in the width of the window, the whole toolbar disappears. Is there a way I can make it so that as you resize it, when you get to the width of the toolbar the inner controls of the form stop resizing and stay displayed, just cut off where the window has resized to? Code is <Grid > <Grid.RowDefinitions> <RowDefinition Height="Auto" /> <RowDefinition Height="Auto" /> <RowDefinition Height="*" /> <RowDefinition Height="Auto" /> </Grid.RowDefinitions> <Grid.ColumnDefinitions> <ColumnDefinition Width="*" /> </Grid.ColumnDefinitions> <ToolBar Grid.Row="1" Height="50" Name="tbMainToolbar" VerticalAlignment="Top" MinWidth="900" > <ToolBar.Background> <LinearGradientBrush StartPoint="0.5,0" EndPoint="0.5,1"> <GradientStop Color="White" Offset="0.0" /> <GradientStop Color="#DCEBFF" Offset="0.25" /> <GradientStop Color="#99CCFF" Offset="0.75" /> <GradientStop Color="#99CCFF" Offset="1.0" /> </LinearGradientBrush> </ToolBar.Background> <DockPanel LastChildFill="True"> <Button Name="btnApproved" DockPanel.Dock="Left" Click="btnToolbar_Click" CommandParameter="APPROVED" Style="{StaticResource ToolbarButtonDisplay}" HelperClasses:ButtonProperties.Image="..\..\Resources\Images\APPROVEU.GIF" Content="Approve"> </Button> ... and so forth for about 20 buttons

    Read the article

  • Can a custom WPF control implement the IsDefault property

    - by jpierson
    I have a custom button control that does not derive from Button. Is it possible for me to implement the equivalent of IsDefault so that the command associated with my control will be invoked. I was hoping that this was an attached property that I could add to any control but as far as I can tell it doesn't seem to be. Am I out of luck if my control does not derive from Button or is there at least a reasonable workaround?

    Read the article

  • Make a c# / wpf event fire only once?

    - by Donnie
    I have a case where I want a given event to execute once, and only once. I'm trying to do it this way, but I'm having prolems (else I wouldn't be asking). Note that the following code is inside the function that decides that the event needs to be fired. EventHandler h = delegate(Object sender, EventArgs e) { FiringControl.TheEvent -= h; // <-- Error, use of unassigned local variable "h" // Do stuff } FiringControl.TheEvent += h; In general this should work because of the way scope is preserved for delegates until after they're done running, but, since h is in the process of being built when I try to use it it is still considered to be "uninitialized", apparently.

    Read the article

  • WPF DataGrid button style

    - by imekon
    If I have a DataGrid in a XAML form, and add the following style: <Style TargetType="Button"> <Setter Property="Margin" Value="2"/> </Style> The data grid locks up the application. I found if I put the style into a resource block that isn't seen by any data grid, then it seems to be happy. However, if I want to have the style above applied to all buttons on my window, I have to put it in various resource blocks that cannot be seen by the data grid. Is there any way to avoid this?

    Read the article

  • How to use two templates for ListViewItem using WPF

    - by Gregor
    Hi, I would like to have a ListView that would have have items similar to Microsoft Outlook inbox with items arranged by Conversations (see the attached photo). An item can either be a simple textblock containing the topic of the conversation (on the photo this are the blue lines) or it can contain email information specified by the ListView's header. It would be best if the items with conversation topics would be push buttons so that emails inside that conversation could be shown or hidden by pressing this button. Any ideas how can I achieve this? Do I specify two ListViewItem templates? If yes, how do I tell in the code which template to use for each item? Any help will be GREATLY appreciated!! Regards, Gregor

    Read the article

  • WPF Control Templating: Keeping Windows look and feel

    - by Tyler
    I'm working on a control template for an inherited TextBox class. I'd like to use this template to add additional controls with the ScrollViewer. I can achieve that goal just fine, what I can't do recreate the border in such away that it matches the Windows look and feel. I have Windows Classic as my theme on XP. Textboxes are typically shown with the standard inset border style. With the XP Fischer Price theme, borders of textbox are a flat style and light blue. Is there any way of specifying something like this in the template? Ideally it would use the theme default (grey inset for Classic, flat and light blue for fischer price theme).

    Read the article

  • Put buttons inside ListBox [WPF]

    - by Andrey
    I want to create list of buttons, and i want buttons to spread across the list item space. Here is what i have: <ListBox Margin="44,54,134,0" Name="listView1" Height="64" > <Button Height="20"></Button> <Button Height="20"></Button> </ListBox> Result is: First pic I want something like second picture, but right side of button to stick to right side of list. I tried to bind in ItemTemplate to ListBox width, but this doesn't work for all cases (if width is Auto) Thanks, Andrey

    Read the article

  • WPF scrollviewer

    - by Bert
    Is there a posibility to scroll to a specific place in a ScrollViewer from your code behind? So something like the Slider element you can change the value property...

    Read the article

  • Storing entity in XML, using MVVM to read/write in WPF Application

    - by Christian
    Say I've a class (model) called Instance with Properties DatbaseHostname, AccessManagerHostname, DatabaseUsername and DatabasePassword public class Instance { private string _DatabaseHostname; public string DatabaseHostname { get { return _DatabaseHostname; } set { _DatabaseHostname = value; } } private string _AccessManagerHostname; public string AccessManagerHostname { get { return _AccessManagerHostname; } set { _AccessManagerHostname = value; } } private string _DatabaseUsername; public string DatabaseUsername { get { return _DatabaseUsername; } set { _DatabaseUsername = value; } } private string _DatabasePassword; public string DatabasePassword { get { return _DatabasePassword; } set { _DatabasePassword = value; } } } I'm looking for a sample code to read/write this Model to XML (preferably linq2XML) = storing 1:n instances in XML. i can manage the the view and ViewModel part myself, although it would be nice if someone had a sample of that part too..

    Read the article

  • WPF Application Typing in Custom TextBox CPU Jumping from 3 to 80 percent

    - by azamsharp
    I have created a RichTextBox called SharpTextBox which indicates and limits the number of characters that can be typed in it. The implementation is shown in the following link: http://www.highoncoding.com/Articles/673_Creating_SharpRichTextBox_for_Live_Character_Count_in_WPF.aspx Anyway when I start typing in the TextBox it goes from 3% to 78%. The TextBox updates the Label control which shows the number of characters remaining for the count. How can I increase the performance of the textbox? UPDATE: I read there seems to be some problem with the TextRange.Text property which kills performance.

    Read the article

< Previous Page | 86 87 88 89 90 91 92 93 94 95 96 97  | Next Page >