Search Results

Search found 11705 results on 469 pages for 'wpf layout'.

Page 19/469 | < Previous Page | 15 16 17 18 19 20 21 22 23 24 25 26  | Next Page >

  • WPF Treeview: How to display rounded border around the selected item?

    - by chikak
    I am trying to set the rounded border around the selected item of the treeview (like the one in the windows explorer on Vista). The problem is that the trigger in the following code doesn't seem to be working. It looks like the IsSelected property is always false. <TreeView x:Name="m_treeView" BorderThickness="0" d:LayoutOverrides="Width, Height"> <TreeView.Resources> <Style TargetType="TreeViewItem"> <Style.Resources> <Brush x:Key="{x:Static SystemColors.HighlightBrushKey}">Transparent</Brush> </Style.Resources> </Style> </TreeView.Resources> <TreeView.ItemTemplate> <HierarchicalDataTemplate DataType="{x:Type local:DirectoryPresentationBase}" ItemsSource="{Binding Children}"> <TreeViewItem> <TreeViewItem.Header> <Border Name="SelectedBorder" CornerRadius="3" Background="#EFF8FD" BorderBrush="#99DEFD" BorderThickness="1" > <StackPanel Orientation="Horizontal"> <interactivity:Interaction.Behaviors> <local:TreeViewExpandBehavior AssociatedTreeView="{Binding ElementName=m_treeView}"/> </interactivity:Interaction.Behaviors> <Image x:Name="img" Width="24" Height="16" Stretch="None" Source="{Binding SmallIcon}"/> <TextBlock Text="{Binding Name}" Margin="5,0" /> </StackPanel> </Border> </TreeViewItem.Header> </TreeViewItem> <HierarchicalDataTemplate.Triggers> <Trigger Property="TreeViewItem.IsSelected" Value="True"> <Setter Property="Background" TargetName="SelectedBorder" Value="Red"/> <Setter Property="BorderBrush" TargetName="SelectedBorder" Value="Green"/> </Trigger> <Trigger Property="TreeViewItem.IsSelected" Value="False"> <Setter Property="Background" TargetName="SelectedBorder" Value="Transparent"/> <Setter Property="BorderBrush" TargetName="SelectedBorder" Value="Transparent"/> </Trigger> </HierarchicalDataTemplate.Triggers> </HierarchicalDataTemplate> </TreeView.ItemTemplate> </TreeView>

    Read the article

  • How does one bind to an List<DataRow> collection in WPF XAML?

    - by Elan
    Using a DataTable or DataView, one can specify the binding in XAML for example as follows: <Image Source="{Binding Thumbnail}" /> In my case I have created a List collection of DataRow objects and the above is not working. This is my data source: List<DataRow> I could of course convert the List< to a DataTable, but I am curious if there was a way to specify the binding in XAML to access the "Thumbnail" column within the DataRow that is stored in a List< collection. Elan

    Read the article

  • WPF: Turning off animations, data binding temporarly for invisible objects?;)

    - by TomTom
    I have a window that contains a tab control - basically multiple sheets with visualizations on them. The visualtizations are: possible very resource intensive during rendering relying on constant data updates to update their underlying models Obviously only one sheet can be visible every time ;) Anyone knows of a good way to turn off all visualization, animations, data binding for a control / panel and it's contained controls? If I would find a way to do that, I could simply turn off all the invisible sheets and reactivate them as needed. The models must be kept running - some of the visual stuff is pretty complex and really relies on constant data updates, and recalculating it when someone switches tabs would be too hard.

    Read the article

  • How to track which character is deleted in TextBox in WPF?

    - by Ashish Ashu
    I want to track which character is deleted by the user through Delete or BackSpace Key. I am handling RichTextBox_ChangedEvent of textbox. Can I extract the deleted character from TextChangedEventArgs *e.Changes* and if yes How can I do that? I want to restrict user to from deleting any characters from the TextBox. I want user can delete only two characters ( let's say "(" or ")" ) Please suggest.

    Read the article

  • WPF - How to style the menu control to remove the left margin?

    - by BrianLy
    I have added a default menu control into my user control. It is being combined with some other controls as part of a custom Window chrome. I need to style the menu to make it appear simpler. The main thing I need to do is to remove the left margin containing the space for the icon or checkbox. How can I do this? XAML: <Menu> <MenuItem Header="MyMeny" FontSize="10"> <MenuItem Header="Options..." /> <MenuItem Header="About" /> </MenuItem> </Menu>

    Read the article

  • WPF - How do I use the UserControl with a dependency property and view model?

    - by user320849
    Hello, My goal is to have a user select a year and a month. Translate the selection into a date and have the user control send the date back to my view model. That part works for me....However, I cannot get the ViewModel's initial date to set those drop downs. public static readonly DependencyProperty Date = DependencyProperty.Register("ReturnDate", typeof(DateTime), typeof(DatePicker), new FrameworkPropertyMetadata{BindsTwoWayByDefault = true,}); public DateTime ReturnDate { get { return Convert.ToDateTime(GetValue(Date)); } set { SetDropDowns(value); SetValue(Date, value); } } The SetDropDowns(value) just sets the selected items on the combo boxes, however, the program never makes it to that method. On the view I am using: <cc1:DatePicker ReturnDate="{Binding Path=StartDate, Mode=TwoWay}" IsStart="True" /> If this has been answered, then my bad. I looked around and didn't see anything that worked for me. Thus, when the program loads how do I get the value from the view model to a method in order to set the combo boxes? Thanks, -Scott

    Read the article

  • How to display combo box as textbox in WPF via a style template trigger?

    - by Greg R
    I would like to display a combobox drop down list as a textbox when it's set to be read only. For some reason I can't seem to bind the text of the selected item in the combo box to the textbox. This is my XAML: <Style x:Key="EditableDropDown" TargetType="ComboBox"> <Style.Triggers> <Trigger Property="IsReadOnly" Value="True"> <Setter Property="Background" Value="#FFFFFF" /> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="ComboBox"> <TextBox Text="{TemplateBinding SelectedItem, Converter={StaticResource StringCaseConverter}}" BorderThickness="0" Background="Transparent" FontSize="{TemplateBinding FontSize}" HorizontalAlignment="{TemplateBinding HorizontalAlignment}" FontFamily="{TemplateBinding FontFamily}" Width="{TemplateBinding Width}" TextWrapping="Wrap"/> </ControlTemplate> </Setter.Value> </Setter> </Trigger> </Style.Triggers> </Style> <ComboBox IsReadOnly="{Binding ReadOnlyMode}" Style="{StaticResource EditableDropDown}" Margin="0 0 10 0"> <ComboBoxItem IsSelected="True">Test</ComboBoxItem> </ComboBox> When I do this, I get the following as the text: System.Windows.Controls.ComboBoxItem: Test I would really appreciate the help!

    Read the article

  • WPF-Can a XAML object be a source as well as a target for bindings?

    - by iambic77
    I was wondering if it's possible to have a TextBlock as a target and a source? Basically I have a bunch of entities which have simple relationships to other entities (like Entity1 Knows Entity3, Entity3 WorksAt Entity2 etc.) I have a Link class that stores SourceEntity, Relationship and TargetEntity details. What I want to be able to do is to select an entity then display the relationships related to that entity, with the target entities of each relationship listed underneath the relationship names. When an entity is selected, an ObservableCollection is populated with the Links for that particular entity (SelectedEntityLinks<Link>). Because each entity could have the same relationship to more than one target entity (Entity1 could know both Entity3 and Entity4 for eg.), I've created a method GetThisRelationshipEntities() that takes a relationship name as a parameter, looks through SelectedEntityLinks for relationship names that match the parameter, and returns an ObservableCollection with the target entities of that relationship. Hope I'm making this clear. In my xaml I have a WrapPanel to display each relationship name in a TextBlock: <TextBlock x:Name="relationship" Text="{Binding Path=Relationship.Name}" /> Then underneath that another Textblock which should display the results of GetThisRelationshipEntities(String relationshipName). So I want the "relationship" TextBlock to both get its Text from the binding I've shown above, but also to provide its Text as a parameter to the GetThisRelationshipEntities() method which I've added to <UserControl.Resources> as an ObjectDataProvider. Sorry if this is a bit wordy but I hope it's clear. Any pointers/advice would be great. Many thanks.

    Read the article

  • Problem in DataBinding an Enum using dictionary approach to a combobox in WPF.

    - by Ashish Ashu
    I have a Dictionary which is binded to a combobox. I have used dictionary to provide spaces in enum. public enum Option {Enter_Value, Select_Value}; Dictionary<Option,string> Options; <ComboBox x:Name="optionComboBox" SelectionChanged="optionComboBox_SelectionChanged" SelectedValuePath="Key" DisplayMemberPath="Value" SelectedItem="{Binding Path = SelectedOption}" ItemsSource="{Binding Path = Options}" /> This works fine. My queries: 1. I am not able to set the initial value to a combo box. In above XAML snippet the line SelectedItem="{Binding Path = SelectedOption}" is not working. I have declared SelectOption in my viewmodel. This is of type string and I have intialized this string value in my view model as below: SelectedOption = Options[Options.Enter_Value].ToString(); 2. The combobox is binded to datadictionary which have two options first is "Enter_value" and second is "Select_value" which is actually Option enum. Based on the Option enum value I want to perform different action. For example if option is equal to option.Enter_value then Combo box becomes editable and user can enter the numeric value in it. if option is equal to option.Select_value value then the value comes from the database and the combo box becomes read only and shows the fetched value from the database. Please Help!!

    Read the article

  • In WPF, how do I update the object that my custom property is bound to?

    - by Timothy Khouri
    I have a custom property that works perfectly, except when it's bound to an object. The reason is that once the following code is executed: base.SetValue(ValueProperty, value); ... then my control is no longer bound. I know this because calling: base.GetBindingExpression(ValueProperty); ... returns the binding object perfectly - UNTIL I call base.SetValue. So my question is, how do I pass the new "value" on to the object that I'm bound to?

    Read the article

  • Sharing a texture resource from DX11 to DX9 to WPF, need to wait for DeviceContext.Flush() to finish

    - by Rei Miyasaka
    I'm following these instructions on TheCodeProject for rendering from DirectX to WPF using D3DImage. The trouble is that now that I have no swap chain to call Present() on -- which according to the article shouldn't be a problem, but it definitely wasn't copying my back buffer. An additional step that I have to take before I can copy the texture to WPF is to share it with a second D3D9Ex device, since D3DImage only works with DX9 (which is understandable, as WPF is built on DX9). To that end, I've modified some SlimDX code to work with DirectX 11. I tried calling DeviceContext.Flush() (the Immediate one) at the end of each render cycle, which kind of works -- most of the time it'll show my renderings, but maybe for maybe 3 or 4 out of 60 frames each second, it'll draw my clear color instead. This makes sense -- Flush() is non-blocking; it doesn't wait for the GPU to do its thing the way SwapChain.Present does. Any idea what the proper solution is? I have a feeling it has something to do with my texture parameters for the back buffer, but I don't know.

    Read the article

  • Why, in WPF, do we set an object to Stretch via its Alignment properties instead of Width/Height?

    - by Jonathan Hobbs
    In WPF's XAML, we can tell an element to fill its container like this: <Button HorizontalAlignment="Stretch" VerticalAlignment="Stretch" /> Why is it that when we set an element to Stretch, we do it via the HorizontalAlignment and VerticalAlignment properties? Why did the WPF design team decide to take this approach over having Width="Stretch" and Height="Stretch"? I presume it was a calculated decision, and I'm curious about the reasoning. CSS, among other technologies, follows the convention that stretching is done via the width and height properties, and that alignment affects positioning exclusively. This seems intuitive enough: stretching the element is manipulating its width and height, after all! Using the corresponding alignment property to stretch an element seems counter-intuitive and unusual in comparison. This makes me think they didn't just pick this option for no reason: they made a calculated decision and had reasons behind it. Width and Height use the double data type, which would ordinarily mean assigning it a string would be silly. However, WPF's Window objects can take Width="Auto", which gets treated as double.NaN. Couldn't Width="Stretch" be stored as double.PositiveInfinity or some other value?

    Read the article

  • How to know if a graphics card provides hardware rendering for wpf

    - by happyclicker
    I have to run a wpf-app in an environment that has all the same dell-pc's with an intel gma 3000 graphics chip (onbard, Q963/Q965). The app renders only with software rendering (Stated so by the RenderCapability.Tier-property (it says the rendering tier is 0!) and I also see this with Perforator). On all of this machines, DirectX 9c is installed and DXDiag states on many but not on all of this machines, that Direct-3d and Direct-Draw-acceleration is activated. I checked also the registry if the setup of these machines disabled wpf-hw rendering but that's also not the case. On one machine I also updated the video-driver and dx with no success. I found a lot of ressources that say, that directX must be installed and active, so that wpf does not use its own software renderer but uses the DirectX HW-Rendering. But on the above machines, DX9c is installed but there is no hw rendering. May it be that wpf uses dx-graphicscards but does the communication with the graphics card direct and not over dx? How can I find out if a specific graphics-chip has to support hardware rendering for wpf or not. The statement that the graphics card must support dx 9c seems not to be the only condition. The second question is, if wpf renders through dx, is this done through direct-3d or is direct-draw used. Is there any good documentation on this topic?

    Read the article

  • WPF issue: Showing HTML <DIV> on top of WPF app

    - by Kangkan
    Hi, I am new to WPF. We are facing one issue. We are showing/launching a WPF browser application from an web (ASPX) application. The web application has a navigator menu with drop-downs (on hover). It works fine till the user is using the web application (aspx pages). But once the WPF application is launched (and is in the foreground on the aspx page) the dropdown menus that are on top of the WPF app is shown below the WPF application. The drop downs are in a <div> and we tried to put the ZINDEX value. But could not get any positive reply. Can somebody help?

    Read the article

  • PanelGridLayout - A Layout Revolution

    - by Duncan Mills
    With the most recent 11.1.2 patchset (11.1.2.3) there has been a lot of excitement around ADF Essentials (and rightly so), however, in all the fuss I didn't want an even more significant change to get missed - yes you read that correctly, a more significant change! I'm talking about the new panelGridLayout component, I can confidently say that this one of the most revolutionary components that we've introduced in 11g, even though it sounds rather boring. To be totally accurate, panelGrid was introduced in 11.1.2.2 but without any presence in the component palette or other design time support, so it was largely missed unless you read the release notes. However in this latest patchset it's finally front and center. Its time to explore - we (really) need to talk about layout.  Let's face it,with ADF Faces rich client, layout is a rather arcane pursuit, once you are a layout master, all bow before you, but it's more of an art than a science, and it is often, in fact, way too difficult to achieve what should (apparently) be a pretty simple. Here's a great example, it's a homework assignment I set for folks I'm teaching this stuff to:  The requirements for this layout are: The header is 80px high, the footer is 30px. These are both fixed.  The first section of the header containing the logo is 180px wide The logo is centered within the top left hand corner of the header  The title text is start aligned in the center zone of the header and will wrap if the browser window is narrowed. It should be aligned in the center of the vertical space  The about link is anchored to the right hand side of the browser with a 20px gap and again is center aligned vertically. It will move as the browser window is reduced in width. The footer has a right aligned copyright statement, again middle aligned within a 30px high footer region and with a 20px buffer to the right hand edge. It will move as the browser window is reduced in width. All remaining space is given to a central zone, which, in this case contains a panelSplitter. Expect that at some point in time you'll need a separate messages line in the center of the footer.  In the homework assigment I set I also stipulate that no inlineStyles can be used to control alignment or margins and no use of other taglibs (e.g. JSF HTML or Trinidad HTML). So, if we take this purist approach, that basic page layout (in my stock solution) requires 3 panelStretchLayouts, 5 panelGroupLayouts and 4 spacers - not including the spacer I use for the logo and the contents of the central zone splitter - phew! The point is that even a seemingly simple layout needs a bit of thinking about, particulatly when you consider strechting and browser re-size behavior. In fact, this little sample actually teaches you much of what you need to know to become vaguely competant at layouts in the framework. The underlying result of "the way things are" is that most of us reach for panelStretchLayout before even finishing the first sip of coffee as we embark on a new page design. In fact most pages you will see in any moderately complex ADF page will basically be nested panelStretchLayouts and panelGroupLayouts, sometimes many, many levels deep. So this is a problem, we've known this for some time and now we have a good solution. (I should point out that the oft-used Trinidad trh tags are not a particularly good solution as you're tie-ing yourself to an HTML table based layout in that case with a host of attendent issues in resize and bi-di behavior, but I digress.) So, tadaaa, I give to you panelGridLayout. PanelGrid, as the name suggests takes a grid like (dare I say slightly gridbag-like) approach to layout, dividing your layout into rows and colums with margins, sizing, stretch behaviour, colspans and rowspans all rolled in, all without the use of inlineStyle. As such, it provides for a much more powerful and consise way of defining a layout such as the one above that is actually simpler and much more logical to design. The basic building blocks are the panelGridLayout itself, gridRow and gridCell. Your content sits inside the cells inside the rows, all helpfully allowing both streching, valign and halign definitions without the need to nest further panelGroupLayouts. So much simpler!  If I break down the homework example above my nested comglomorate of 12 containers and spacers can be condensed down into a single panelGrid with 3 rows and 5 cell definitions (39 lines of source reduced to 24 in the case of the sample). What's more, the actual runtime representation in the browser DOM is much, much simpler, and clean, with basically one DIV per cell (Note that just because the panelGridLayout semantics looks like an HTML table does not mean that it's rendered that way!) . Another hidden benefit is the runtime cost. Because we can use a single layout to achieve much more complex geometries the client side layout code inside the browser is having to work a lot less. This will be a real benefit if your application needs to run on lower powered clients such as netbooks or tablets. So, it's time, if you're on 11.1.2.2 or above, to smile warmly at your panelStretchLayouts, wrap the blanket around it's knees and wheel it off to the Sunset Retirement Home for a well deserved rest. There's a new kid on the block and it wants to be your friend. 

    Read the article

  • WPF Alphabet (Available for download)

    - by mbcrump
    WPF Alphabet is a application that I created to help my child learn the alphabet. It displays each letter and pronounces it using speech synthesis. It was developed using WPF and c# in about 3 hours (so its kinda rough). I went ahead and uploaded it to codeplex for those in similar situation or just wanting to see a particular WPF feature. I would also recommend Scott Hanselman’s BabySmash!. Specific WPF Features: DispatcherTimer (WPF) SpeechSynthesizer (WPF) URL Navigate (WPF) not PAGE XAML Examples: DockPanel Border TextBlock HyperLink Button's and Events Download full source and binaries here.

    Read the article

  • Android layout with 2 evenly spaced Buttons

    - by Rpond
    I have this layout that works correctly, a relative layout with a text view and two buttons spaced evenly below it. <RelativeLayout android:id="@+id/entrypopup" android:layout_width="fill_parent" android:layout_height="wrap_content" android:padding="5px" android:visibility="gone" android:layout_below="@+id/ad" android:background="#80000000"> <TextView android:id="@+id/title" android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="Entry Popup..." android:textColor="#ffffffff" android:textSize="20sp" /> <TableLayout android:id="@+id/TableLayout01" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_below="@id/title"> <TableRow android:layout_weight="1"> <Button android:id="@+id/buttonVisit" android:text="View" android:layout_height="fill_parent" android:layout_width="0dip" android:layout_weight="1"/> <Button android:id="@+id/buttonCancel" android:text="Cancel" android:layout_width="0dip" android:layout_weight="1" android:layout_height="fill_parent"/> </TableRow> </TableLayout> </RelativeLayout> But running layoutopt it says that "this TableRow layout or its TableLayout parent is possible useless". Is there a way to do this layout then without the tables?

    Read the article

  • CSS layout that fills available space

    - by Jared I
    I'm trying to do a seemingly simple webpage layout, but I'm hitting a wall. I'd like to do everything purely with CSS (no tables to much things up, and no javascript dynamically resizing things) I'd like to have: A heading with a fixed height A footer with a fixed height Left sidebar with a fixed width Right sidebar with a fixed width The whole layout always fills the entire viewport (i.e. if the user resizes the window, the layout grows to the new size) Put another way: |< Total width is 100% of viewport >| +--------------------------------------------------------------+ --- | Header with a fixed height | ^ |--------+-------------------------------------------+---------+ | | | | | | | | | Left | | Right | Total | with | Center grows in height/width | with | height | fixed | and has scrollbars if necessary | fixed | is | width | | width | 100% | | | | of | | | | viewport | | | | |--------+-------------------------------------------+---------| | Footer with a fixed height | v +--------------------------------------------------------------+ --- The parts that are giving me the most trouble are Having the sidebars and center have a height equal to the height of the viewport minus the heights of the header and footer Having the center have a width equal to the width of the viewport minus the widths of the two sidebars I have no problem requiring users to have a modern browser. I'm aware that similar questions to this have been asked before, such as Make a div fill remaining space (http://stackoverflow.com/questions/1717564) Three row tableless CSS layout with middle row that fills remaining space (http://stackoverflow.com/questions/1703455) Create 2 divs, one takes up remaining space (http://stackoverflow.com/questions/1717564) ... and the conclusion seems to be that there isn't a good solution. Those answers are somewhat old, so I'm hoping that someone knows the trick now.

    Read the article

  • Creating a horizontal fluid layout in css that works like a table

    - by ivordesign
    Basically what i am after is a fluid solution in css, that is similar to the table layout below.The principal behind this layout is 3x3 grid where by a user can add content into the first fluid area and it will expand the complete width of the page. But if that user decides that he wants content in the 2nd and 3rd area, all 3 td's fill up 33% of the width. Effectively what i am asking is how do i create a css based layout that can do the same as the table layout? <table width="100%"> <tr> <td id="leftZone" > fluid area here </td> <td > fluid area here </td> <td id="rightZone"> fluid area here </td> </tr> </table> <table width="100%"> <tr> <td valign="top" > fluid area here </td> <td > fluid area here </td> <td > fluid area here </td> </tr> </table> <table width="100%"> <tr> <td > fluid area here </td> <td > fluid area here </td> <td > fluid area here </td> </tr> </table>

    Read the article

  • Nested Linear layout only shows first view after being set from gone to visible in Android

    - by Adam
    Hi guys, I am developing an Android app but I'm still pretty new. I want to have a button, and when you push that button, a few TextViews and Buttons will appear. So I have a main linear layout, and then another linear layout nested inside containing the things I want hidden. I have the nested linear layout set to android:visibility="gone". The problem I am having is that it only shows the first item inside the hidden linear layout instead of all of them. The way I try to make it appear is vgAddView = (ViewGroup)findViewById(R.id.add_details); btnAche.setOnClickListener(new OnClickListener(){ public void onClick(View v){ vgAddView.setVisibility(0); } }); My XML file is this <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent" > <Button android:text="@string/but_stomach_ache" android:id="@+id/but_stomach_ache" android:layout_width="fill_parent" android:layout_height="wrap_content"> </Button> <Button android:text="@string/but_food" android:id="@+id/but_food" android:layout_width="fill_parent" android:layout_height="wrap_content"> </Button> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent" android:id="@+id/add_details" android:visibility="gone"> <TextView android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent" android:text="@string/when_happen"> </TextView> <Button android:text="@string/happen_now" android:id="@+id/happen_now" android:layout_width="fill_parent" android:layout_height="wrap_content"> </Button> </LinearLayout> </LinearLayout>

    Read the article

  • Looping the layout that was set up in Interface Builder

    - by Slavenko
    I just need for someone to point me in the right direction of how I should be doing things. I wanted to make an iOS news like app that would have interface resembling Windows Phone. Large and small image tiles that represent one news item each. Now I was thinking to create some basic layout in storyboard, that would consist out of, for example, a title, and a 3 different sized tiles/images (the gray part on the attached image). Now, I would be getting the data as a JSON array that has holds different news categories so I was wondering if somehow the set up layout could be reused in a for loop since the layout will only repeat itself (the red part on the attached image) and oly the data would be different. Can this be done, should I even try doing something like this, or should I try to create an entire layout programmatically? I wouldn't mind doing it programatically, it's just that I don't have much experience in creating layouts that way, and wanted to make sure that I don't do something that I might regret later. Thank you for any help and advice.

    Read the article

< Previous Page | 15 16 17 18 19 20 21 22 23 24 25 26  | Next Page >