Search Results

Search found 6542 results on 262 pages for 'wpf panels'.

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

  • WPF DataGrid : CanContentScroll property causing odd behavior

    - by Sonic Soul
    i have a solution where i generate a DataGrid (or multiple instances) based on user criteria.. each grid keeps receiving data as it comes in via ObservableCollection the problem i had, was that the scroll acted weird. It was choppy, and scrollbar would resize it self while scrolling. than i found.. CanContentScroll property! It completely fixes the weird scrolling behavior bringing me temporary bliss and happiness. however, it causes 2 unfortunate side effects. whenever i re-create grid instances and bind them to my observable collection, it freezes my entire window for 5 seconds. when my grid grows to a big size, this delay can last for 30 seconds. when i call TradeGrid.ScrollIntoView(TradeGrid.Items(TradeGrid.Items.Count - 1)) to scroll to the bottom, it jumps to bottom and than back to the top. is there another way to achieve smooth scrolling perhaps?

    Read the article

  • WPF: How do I debug binding errors?

    - by Jonathan Allen
    I'm getting this in my output Window: System.Windows.Data Error: 4 : Cannot find source for binding with reference 'RelativeSource FindAncestor, AncestorType='System.Windows.Controls.ItemsControl', AncestorLevel='1''. BindingExpression:Path=VerticalContentAlignment; DataItem=null; target element is 'ListBoxItem' (Name=''); target property is 'VerticalContentAlignment' (type 'VerticalAlignment') This is my XAML, which when run looks correct <GroupBox Header="Grant/Deny Report"> <ListBox ItemsSource="{Binding Converter={StaticResource MethodBinder}, ConverterParameter=GrantDeny, Mode=OneWay}"> <ListBox.ItemTemplate> <DataTemplate> <StackPanel Orientation="Horizontal"> <Label Content="{Binding Entity}"/> <Label Content="{Binding HasPermission}"/> </StackPanel> </DataTemplate> </ListBox.ItemTemplate> </ListBox> </GroupBox>

    Read the article

  • multy threading wpf

    - by Eran
    Hey, I'm using web refernce call in new working thread in my application as follow: Thread callRunner = new Thread(delegate() { _mediator.IncomingCallDetails(phoneNumber); }); callRunner.Start() ; the _mediator calls the web refernce and replay to the caller in event as follow: void IncomingCallComplited(IncomingCallEventArg args) { Caller = args.Caller; Lodgers = args.Lodgers; PreviousMissions = args.PreviousMissions; } Caller ,Lodgers and PreviousMissions are properties of an object that bind to GUI element,as for now the binding works fine and i can see the values from the web refernce in screen my question is should I use Dispatcher in the event or in any other phase ? and if I do can someone please explain why? Thanks Eran

    Read the article

  • multi threading wpf

    - by Eran
    Hey, I'm using web refernce call in new working thread in my application as follow: Thread callRunner = new Thread(delegate() { _mediator.IncomingCallDetails(phoneNumber); }); callRunner.Start() ; the _mediator calls the web refernce and replay to the caller in event as follow: void IncomingCallComplited(IncomingCallEventArg args) { Caller = args.Caller; Lodgers = args.Lodgers; PreviousMissions = args.PreviousMissions; } Caller ,Lodgers and PreviousMissions are properties of an object that bind to GUI element,as for now the binding works fine and I can see the values from the web reference in screen my question is should I use Dispatcher in the event or in any other phase ? and if I do can someone please explain why? Thanks Eran

    Read the article

  • WPF - Translate a point relative to MainWindow to it's coordinates relative to a child control

    - by James Cadd
    Is it possible to translate a point relative to MainWindow to be relative to one of its child controls? For example, say a control's upper left corner was located at 500, 500 relative to MainWindow what code would convert that number to (0, 0)? I'd like the solution to be agnostic of the layout mechanism (i.e. not require me to parent the control in a Canvas and use the Top and Bottom methods).

    Read the article

  • How to avoid coupling when using regions in Composite WPF

    - by emddudley
    I have an application designed using Microsoft's Composite Application Library. My shell has several regions defined so that I can inject content from separate modules. I'm looking for a design pattern that will reduce the coupling that these regions introduce. In all examples I have seen, regions are defined and accessed using a string in a static class in the infrastructure project.: <ItemsControl cal:RegionManager.RegionName="{x:Static inf:RegionNames.TabRegion}"> public static class RegionNames { public const string TabRegion = "TabRegion"; } This introduces an dependency on the shell from the infrastructure project, because the infrastructure project is now defining some of the shell's capabilities. The CAL RegionManager throws an exception if you attempt to access a region which is not defined, so I must ensure that the infrastructure and shell projects are kept in sync. Is there a way to isolate the shell's regions so that they are defined only within the shell (no region names in the infrastructure project)? Is there a way to make regions optional, so that shells can be swapped out even if they don't have all the same regions? (An example: One shell has menu and toolbar regions, another only has the menu... modules should be able to inject into the toolbar if it's available, without failing when it's not)

    Read the article

  • WPF Dockable Windows Like iGoogle

    - by Anon
    I'm looking for a dockable windows/panel control in the style of iGoogle. All of the ones I have found so far all have a fixed length on the height of your window/panel but I want to be able to have windows of varying length like iGoogle. The best I have found so far has been a control libarary called BlackLight which does not have the feature explained above.

    Read the article

  • WPF custom Button using Geometry from resource

    - by theburningmonk
    Is there a way to use a collection of PathGeometry like these: Path 1 F1 M 170.255,178.837L 170.255,221.158C 170.255,228.917 164.174,230.777 156.745,225.286L 136.003,209.973C 128.572,204.488 128.572,195.512 136.003,190.023L 156.745,174.706C 164.174,169.217 170.255,171.079 170.255,178.837 Z Path 2 F1 M 152.29,174.464L 134.314,187.734C 129.978,190.937 127.589,195.29 127.589,199.994C 127.589,204.7 129.978,209.057 134.314,212.26L 152.29,225.531C 150.333,229.378 145.412,229.52 139.678,225.286L 118.935,209.973C 111.506,204.489 111.506,195.512 118.935,190.022L 139.678,174.708C 145.412,170.475 150.333,170.617 152.29,174.464 Z and use them to make a custom button in the same way you can make a circular button shown in this example? http://www.wpftutorial.net/Templates.html The example involves overriding the control template and it seems a lot of work if I want to have many custom-shaped buttons. And what if I want to load the geometry points from the resource?

    Read the article

  • WPF TypeConverter ConvertTo not firing

    - by JFoulkes
    Hi, I have a dependency property in a class which I need to be converted to a string. I have added the TypeConverty attribute on the property. The type I am converting is the .net Style class. [TypeConverter(typeof(BulletStyleTypeConverter))] public Style BulletStyle { get { return (Style)GetValue(BulletStyleProperty); } set { this.SetValue(BulletStyleProperty, value); } } When I put the string "Rectangle" in for BulletStyle in xaml it hits the ConvertFrom method in my converter. However, when I use XamlWriter.Save() to serialise this, the property does not appear as an attribute in the string which is produced. I have implemented ConvertTo and put a breakpoint on, which is never hit. I have implemented CanConvertTo and put a breakpoint on, which IS hit and returns true. So i'm stumped as to why ConvertTo never fires.

    Read the article

  • Resize listview in WPF

    - by sDev
    Hi, How to resize listview when main window is resized? Sorry for editing. Want to set the minwidth for gridviewcolumn. So the listview column is set to the min width when page is resized. Is it possible? Thanks SD </GridViewColumn> <GridViewColumn Header="Item"> </GridViewColumn> <GridViewColumn Header="Price"> </GridViewColumn> <GridViewColumn Header="Total Price1"> </GridViewColumn> </GridView> </ListView.View> </ListView> </Grid>

    Read the article

  • WPF - Setting usercontrol width using triggers and mouseenter event

    - by BigBadJock
    I have a wrap panel full of usercontrols. When I hover the mouse over a usercontrol I want it to expand to show more details. Some stripped down sample code: <UserControl x:Class="WPFTestBed.UserControl1" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Height="300" Width="300"> <UserControl.Resources> </UserControl.Resources> <UserControl.Triggers> <EventTrigger RoutedEvent="Mouse.MouseEnter"> <EventTrigger.Actions> <Setter TargetName="WPFTestBed.UserControl1" Property="Control.Width" Value="200"/> </EventTrigger.Actions> </EventTrigger> </UserControl.Triggers> <Grid Height="95" Width="123"> <Button Height="23" HorizontalAlignment="Left" Margin="17,30,0,0" Name="button1" VerticalAlignment="Top" Width="75">Button</Button> </Grid> </UserControl> I would appreciate it if someone could point out where I'm going wrong, and set me down the correct path. Ideally, I want the usercontrol to delay for x seconds when there is a mouseover, before expanding and showing the extra details.

    Read the article

  • wpf - window to be tight round user control

    - by Andy Clarke
    Hi, I've got a user control that I'm loading into a Window dynamically - I wanted to set the Window so that it didn't have a size and then I thought the window to resize accordingly depending on the UserControl. However it dosn't - can anyone assist please? I've made a very basic example - I've cut out the dynamic bits and just put a UserControl in a Window. What do I need to do to get the window to be tight around the UserControl? Thanks, Andy <UserControl x:Class="WpfApplication1.UserControl1" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Height="300" Width="300" Background="LightBlue"> <Grid> </Grid> </UserControl> <Window x:Class="WpfApplication1.Window1" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:WpfApplication1="clr-namespace:WpfApplication1" Title="Window1" > <Grid> <WpfApplication1:UserControl1> </WpfApplication1:UserControl1> </Grid> </Window>

    Read the article

  • Create a grid in WPF as Template programmatically

    - by wickie79
    I want to create a basic user control with a style programmatically. In this style i want to add a Grid (no problem), but i dont can add column definitions to this grid. My example code is ControlTemplate templ = new ControlTemplate(); FrameworkElementFactory mainPanel = new FrameworkElementFactory(typeof(DockPanel)); mainPanel.SetValue(DockPanel.LastChildFillProperty, true); FrameworkElementFactory headerPanel = new FrameworkElementFactory(typeof(StackPanel)); headerPanel.SetValue(StackPanel.OrientationProperty, Orientation.Horizontal); headerPanel.SetValue(DockPanel.DockProperty, Dock.Top); mainPanel.AppendChild(headerPanel); FrameworkElementFactory headerImg = new FrameworkElementFactory(typeof(Image)); headerImg.SetValue(Image.MarginProperty, new Thickness(5)); headerImg.SetValue(Image.HeightProperty, 32d); headerImg.SetBinding(Image.SourceProperty, new Binding("ElementImage") { RelativeSource = new RelativeSource(RelativeSourceMode.TemplatedParent) }); headerPanel.AppendChild(headerImg); FrameworkElementFactory headerTitle = new FrameworkElementFactory(typeof(TextBlock)); headerTitle.SetValue(TextBlock.FontSizeProperty, 16d); headerTitle.SetValue(TextBlock.VerticalAlignmentProperty, VerticalAlignment.Center); headerTitle.SetBinding(TextBlock.TextProperty, new Binding("Title") { RelativeSource = new RelativeSource(RelativeSourceMode.TemplatedParent) }); headerPanel.AppendChild(headerTitle); FrameworkElementFactory mainGrid = new FrameworkElementFactory(typeof(Grid)); FrameworkElementFactory c1 = new FrameworkElementFactory(typeof(ColumnDefinition)); c1.SetValue(ColumnDefinition.WidthProperty, new GridLength(1, GridUnitType.Star)); FrameworkElementFactory c2 = new FrameworkElementFactory(typeof(ColumnDefinition)); c2.SetValue(ColumnDefinition.WidthProperty, new GridLength(1, GridUnitType.Auto)); FrameworkElementFactory c3 = new FrameworkElementFactory(typeof(ColumnDefinition)); c3.SetValue(ColumnDefinition.WidthProperty, new GridLength(3, GridUnitType.Star)); FrameworkElementFactory colDefinitions = new FrameworkElementFactory(typeof(ColumnDefinitionCollection)); colDefinitions.AppendChild(c1); colDefinitions.AppendChild(c2); colDefinitions.AppendChild(c3); mainGrid.AppendChild(colDefinitions); mainPanel.AppendChild(mainGrid); FrameworkElementFactory content = new FrameworkElementFactory(typeof(ContentPresenter)); content.SetBinding(ContentPresenter.ContentProperty, new Binding() { RelativeSource = new RelativeSource(RelativeSourceMode.TemplatedParent), Path = new PropertyPath("Content") }); mainGrid.AppendChild(content); templ.VisualTree = mainPanel; Style mainStyle = new Style(); mainStyle.Setters.Add(new Setter(UserControl.TemplateProperty, templ)); this.Style = mainStyle; But the creation of FrameworkElementFactory with type ColumnDefinitionCollection will throw an exception "'ColumnDefinitionCollection' type must derive from FrameworkElement, FrameworkContentElement, or Visual3D." Who can help me?

    Read the article

  • ComboBox wpf not item not being selected

    - by Greg R
    I am trying to bind a combo box to a list of objects, and it works great, besides the selected value, am I missing somethign? <ComboBox ItemsSource="{Binding OrderInfoVm.AllCountries}" SelectedValuePath="country_code" DisplayMemberPath="country_name" SelectedValue="{Binding OrderInfoVm.BillingCountry}" /> Basically I want to bind value to country codes and set the selected value to the country code bound to OrderInfoVm.BillingCountry (which implements INotifyPropertyChanged) Initially when the control loads selected value is empty, but on click BillingCountry is populated. Selected value does not seem to change. How can I remedy that?

    Read the article

  • ListView containing Bitmaps with Zoom Animation in WPF

    - by Ashish Ashu
    I have a simple requirement as mentioned below: A ListView or any control displays list of bitmaps/images. When user mouse hovers on any bitmap that bitmap zoomed to show that is currently selected. Since I have to provide drag drop operations and click operation that why I taken the list view. Pleas help!! It will be great if any body provide the xaml to this..

    Read the article

  • To show the help related information in WPF.

    - by Ashish Ashu
    I have several dialogs in the application. I want to pop up help related box when user clicks on the help button next to Main Heading. The help box is activated by selecting the small blue icon next to the heading. When the help box appears it has the information that is required to understand the entry related to the dialog. This help box automatically disappears when user clicks any where other then the help box. Please help!!

    Read the article

  • Date Picker Today Option In WPF

    - by Asim Sajjad
    Is there any property , option available in the date picker control so that if user want to select today from any date from current date ? e.g if user is view current month of last year then he has the option to select current date ?

    Read the article

  • Why does WPF toggle button pulse once unchecked

    - by randyc
    Wihtin a Desktop app I have a toggle button: For the Checked event I am setting a value and then executing a method FilterView(); //ommitting code Unchecked state is just the opposite. resets a variable and executed the method again The question I have is I noticed when I uncheck the toggle button the button continues to pulse or flash ( going from blue to chrome) as if it still has focus. The button will stay like this until another button is clicked. Is there a way to remove this focus so that when the button is unchecked the button goes back to a unchecked state without the flashing / pulsing color. As you can see from above this is a standard toggle button no styles or custom I tested this on just a regular button and I found the same occured when clicked the button will continue to pulse / flash until another button is clicked. How do you work around this or prevent this effect from happening. Thank you

    Read the article

  • WPF TextBlock binding with <LineBreak/>

    - by Vinjamuri
    I have a TextBlock binding as follows in my ControlTemplate. When I set ButtonText as follows with , it doesn't work. It doesn't display in separate line. ButtonText="Change Casette" How to fix this? Appreciate your help, please provide me with sample code.

    Read the article

  • WPF designer gives exception when databinding a label to a checkbox

    - by John
    I'm sure it's something stupid, but I'm playing around with databinding. I have a checkbox and a label on a form. What I'm trying to do is simply bind the Content of the label to the checkbox's IsChecked value. What I've done runs fine (no compilation errors and acts as expected), but if I touch the label in the XAML, the designer trows an exception: System.NullReferenceException Object reference not set to an instance of an object. at MS.Internal.Designer.PropertyEditing.Editors.MarkupExtensionInlineEditorControl.BuildBindingString(Boolean modeSupported, PropertyEntry propertyEntry) at <Window x:Class="UnitTestHelper.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:FileSysCtls="clr-namespace:WPFFileSystemUserControls;assembly=WPFFileSystemUserControls" xmlns:HelperClasses="clr-namespace:UnitTestHelper" Title="MainWindow" Height="406" Width="531"> <Window.Resources> <HelperClasses:ThreestateToBinary x:Key="CheckConverter" /> </Window.Resources> <Grid Height="367" Width="509"> <CheckBox Content="Step into subfolders" Height="16" HorizontalAlignment="Left" Margin="17,254,0,0" Name="chkSubfolders" VerticalAlignment="Top" Width="130" IsThreeState="False" /> <Label Height="28" HorizontalAlignment="Left" Margin="376,254,0,0" Name="lblStepResult" VerticalAlignment="Top" Width="120" IsEnabled="True" Content="{Binding IsChecked, ElementName=chkSubfolders, Mode=OneWay, UpdateSourceTrigger=PropertyChanged, Converter={StaticResource CheckConverter}}" /> </Grid> The ThreeStateToBinary class is as follows: class ThreestateToBinary : IValueConverter { #region IValueConverter Members public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) { if ((bool)value) return "Checked"; else return "Not checked"; //throw new NotImplementedException(); } public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) { return ((string)value == "Checked"); //throw new NotImplementedException(); } #endregion } Quite honestly, I'm playing around with it at this point. It was originally simpler (not using the ValueConverter) but was displaying similar behavior when I simply had the content set to: Content="{Binding IsChecked, ElementName=chkSubfolders, UpdateSourceTrigger=PropertyChanged}" Any ideas? Thanks, John

    Read the article

  • Wpf nesting containers

    - by dortzur
    On a window control, my main container is a grid. My grid has 2 rows, one row definition is 50*, and the other is 250*. Now i want to add a right sidebar, lets say with a StackPanel. I would like to have a ListBox inside the StackPanel that aligns with the 50* grid row, so as the window height gets bigger, the ListBox size will also get bigger. My question is whether i can achieve this behavior while the ListBox is inside the StackPanel (which is nested inside the grid) or must the ListBox be placed directly inside the grid?

    Read the article

  • WPF: Databinding and Combo Boxes

    - by Jonathan Allen
    I have two classes Company CompanyKey CompanyName Person FirstName LastName CompanyKey The list items on the combo box is bound to a collection of CompanyObjects. How to I databind the selected item property of the Combobox to the Person.CompanyKey property?

    Read the article

  • WPF ComboBox Object Binding - not updating DataContext Object

    - by Jaysen
    Hello, I have the following scenario: 1 class called 'Widget' with the properties: ID, Code, Description 1 class called 'MyWidget' with a property: m_Widget As Widget 1 ComboBox The ComboBox has a List(Of Widget) set as the ItemSource. I create an instance of 'MyWidget' named MyWidget1 and I set the property values of the m_Widget to match one of the items in the 'ComboBox List(Of Widget)'. I then set the DataContext of the ComboBox to MyWidget1.Widget. When I change the ComboBox selected item, only the ID property of 'MyWidget1.Widget' gets updated... How do I get the object 'Widget' on 'MyWidget1' to be updated instead of just 'MyWidget1.Widget.ID'? Here is a link to a sample project demonstrating this scenario: http://www.webpersona.com/ObjectBinding.zip Thanks in advance for any help :)

    Read the article

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