C# - WPF: Binding TreeView In XAML
Dec 8, 2010I have a data source:
[Code]....
I have a data source:
[Code]....
Following is the code I wrote for generating treeview hierarchy,
For Each k As KeyValuePair(Of String, GenreSet) In GenreSetDictionary
Dim t As New TreeNodeSet
t.Genre = True
[code]....
I have the below xaml that I am trying to bind to my class. I am having trouble getting the values to show up.
code]...
i'm building a Videoplayer custom control (Project called WpfCustomControlLibrary1) and want to add a Load Command.This is what i have added in my class to get this Command:
Public Class VideoPlayer
Inherits Control
...
Public Shared ReadOnly LoadCommad As RoutedUICommand
....
[code].....
i get an error that he cant convert the string in the Attribute "Command" into an Object of the Type "System.Windows.Input.ICommand
I need to use the xaml writer to convert in string some controls. What I get is a string like this for example
[code]...
I'm trying to bind a WinForms TreeView control to some user-defined objects. In particular, I'd like to bind aTreeNode.Text property to myObject.Name. My strategy is to create xTreeNode, a subclass of TreeNode, add a DataBindings collection, and expose its Text property.
This would allow me to write some code like this:
Dim oBinding as Binding
Dim bs as New BindingSource
bs.DataSource = myObj
[code]....
I have a problems with my application..
1. collapse and expand treeview when i click plus sign (+) on treeview, treeview didn't expand subfolder but when i click image, treeview expand it.
2. showing path that i check on treeview when i check the treeview then i'm click the button, then return path that i check
This is my code..
is there any way that i could link/bind multiple binding source to only one binding source navigator?
View 4 RepliesI have been watching "absolute video tutorial". In those tutorials when doubled clicked on stuffs like "button" or "textbox", a code page appears named as "mainpage.xaml.cs" but when I use Visual Basics and do the same, on double click a page "mainpage.xaml.vb" appears. In this the coding stuffs are different. And when I write the same codes like in tutorial I get errors.
View 6 Repliesbinding navigators, datagrid view, binding source are all sql database parts.Will these parts still work if you havent got sql on you pc and your not using an database file (.log and .mfd) and your not coding to them, im using MS Jet/Oledb to code to Excel.What not to put on an Employee evaluation: This employee has hit rock bottom and shows signs of starting to dig.
View 2 RepliesBinding Master Table to TextBox and DateTimePicker and Binding Details Tables to Datagridview then Add / Update / Delete in both
View 8 RepliesIs there a way to access My.Resources thru Xaml?
Like this
<Image Source="{Binding MyImage,
Source={x:Static my:Resources},
Converter={StaticResource MyBitmapToImageSourceConverter}}" />
[Code]....
I was just wondering if it's possible to animate the height of a grid using purely XAML? I looked at this tutorial[url]...
View 2 RepliesHow can I implement both of these ObservableCollections in my xaml? I want to have a listview with all my students, and another listview with all my teachers.For now I just made an example student and teacher object. Am I going about this the wrong way. Eventually I will pulling from a datatable, not sure how I would implement it to the ObservableCollection though.
Public Class PersonalViewModel
Public Sub New()
Dim obcollection1 As New ObservableCollection(Of Student)
[Code].....
I'm doing a WPF project and decided to try it out with Visual Basic. So, basically I'm trying to set the height of a row in a Grid. I'm not great at programming but with C# I managed somehow to figure it out, without remembering how. It actually looks like an animation because when clicking the button, the height of one row smoothly goes down to 0. But I'm trying to even reach that property and I can't figure out the context. The row is called "AnimationRow" and I can reach that, but where do I set the height?
View 1 RepliesI am new to WPF and XAML. I want to learn these for use in VB express 2008.Please guide me for some tutorials to start and progress in WPF and XAML.
View 3 Repliesi have a treeviev and listbox.i want to display the selected contents of treeview into the listbox.my code is working for file but not for folder. means i want, if the all contents of folder ABC(i.e all files) are selected then in listbox i want to show the only path of folder not the seperate path of each file.
View 1 RepliesI've currently created the class below. For some reason though I can't access the properties I've created through my xaml style.
Public Class Ribbon : Inherits Button
Private mpopDropdown As Popup
Public Property Dropdown() As Popup
[Code].....
but they don't seem to expose the property either. I've also tagged the property as <Bindable(True)> but that didn't seem to do anything.
Look at this simple bug :
<textblock (...) Width="0" />
Working great, the textBox appears to be 0px thin. Works with value like, 2, 3, 4...
Now that is NOT working :
<TextBlock (...) />
<TextBlock.Width>
<MultiBinding Converter="{StaticResource WidthConverter}">
[CODE]..................
Why can i set zero value to TextBox.Width in xaml and not in code behind ? By using a converter, when returing 0, the TextBlock.Width is not set to 0 but to "auto", i can read the text
I want to bind data to an objectdataprovider.[code]...
View 1 Repliesi created a Xaml screen with a border and a button.
Border - <Border x:Name="SideMenu" MinHeight="40" MaxHeight="400" Height="400" Opacity="0.2" BorderBrush="Black" BorderThickness="2" CornerRadius="5" VerticalAlignment="Top" Margin="1345,0,0,0" HorizontalAlignment="Left" Width="255" Visibility="Collapsed">
[Code]...
What I am trying to accomplish: Create a dynamic bubble that expands on height and width depending on the amount of text in the bubble. What I researched so far: In a SO article they described utilizing the measurestring function to figure out the exact width or height so dynamic changes in the .cs to the width and height can be accomplished.
[Code]...
here's what I'm trying to do:I have a Storyboard animation for an object done in Expression Blend. What I need is to be able to trigger that animation from the VB.net code
View 2 RepliesI tried saving data from my rich text box using the TextRange to save in xamlpackage format, however my question is basic, what extension should the file have, if I use Xaml, the normal wpf xaml files would not be capable of opening as they are not xamlpackages
View 1 RepliesI know I gotta get a book or something because things are just way too hard for me. But before that happens I have what I think should be an easy question.
I want to create a variable in xaml, the angle that a control is currently at, and then use this variable in my VB code (event handler).
Or even better can I, while in VB code, check the current angle a specific control is at so that I can add to the number when setting the new angle?
I have a WPF app that is currently driven completely from XAML. All fields, datagrids everything are bound from XAML using ObjectDataProviders objects. I have a DataAccessLayer (DAL) imported into the project. The calls to retrieve data using the ODPs are being used to display the data are all working. Is it possibly to perform inserts, updates, deletes using the methods that exist in my DAL directly from the XAML? I am trying to avoid ANY code-behind here at all to keep the UI a separate entity. I cannot find any clear cut examples with insert, update, deletes on this.
View 1 RepliesI've gotten to a point where I'm trying to add a ComboBox to a UserControl, and to populate it from a collection which exists in code.
I've been getting along pretty much on monkey-see-monkey-do coding for the most part; copying and adapting existing code in order to get the next stage working, but this DataSource stuff has me stumped. I've been through a whole bunch of articles on MSDN this morning and am no closer to understanding than I was when I started.
Let me go through a few of the things that are messing with me, and hopefully you guys will be able to point me in the right direction:
1) None of the [UserControlName].vb files contains any code. All of the code for the UserControls is stored in [UserControlName]Model.vb files, and then code of the following sort is used:
<UserControl
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:l="clr-namespace:MySolution"
[Code]....
1.5) (using bullet points means I can't use <> brackets or code blocks later on. What the hell, markdown?) Anyway...
2) I'm pretty sure I only want a Static Source for the moment, as the items in the ComboBox aren't going to change during execution, at this time. Problem is, all the articles I can find about this are gigantic, complex things about creating XML readers, and populating DataGridViews and sorting data, and on and on and on. I just want to declare that I'm using a frealing List! A List I've already created in code.
So, yeah, I basically need to use a Public Property ComboBoxLines As List(Of String) from a class which isn't the same class as the UserControl itself as the DataSource for a ComboBox.
Visual Basic 2010. For a school assignment i had to make a application with XAML in it. I made the tutorial Math Quiz when starting up Visual Basic 2010. This was a Windows Form application that only needed VB programming language. Now i made the Math Quiz and finished it but there is no XAML included or what so ever. Can I still convert this to XAML or just see any XAML language somewhere. Cause I need to proove to my Teacher the application I made includes XAML.
View 1 RepliesI am new to WPF and the MVVM design pattern this month, and more than a little out of practice in general. To learn, I've been playing around with textboxes, rectangles, and ways to display them in a window. I began with Ashley Davis' excellent "Simple Drag Selection in WPF" tutorial, which walks through creating a view model for a collection of rectangles, binding a listbox to said collection, and styling the listbox with a canvas, creating a data template for the rectangles, as well as basic "rubber band" selection logic.
I have since built on this tutorial to improve the drag selection so that it behaves much more like selection does in windows explorer, and to allow resizing the rectangles from the corners or edges.All was well until I changed the MainWindow.xaml in an effort to include a column on the side for various buttons and controls, thus moving the "editor surface" grid from inside a 1x1 grid on the main window to a column of a 1x2 grid, moving the data template to the grid's resources (since it will be the only element in the window that needs it). As soon as I did this, subroutines that I wrote which interact with the listbox started misbehaving--rubber band selection no longer works. There's no visual indication that listbox items are being selected (they were highlighted previously), and interrogating listBox.SelectedItems.Count after a drag-selection mouseUp event returns a zero.
After some experimentation, reading many questions on this site and sections of my WPF Unleashed book, and going over the msdn databinding overview, as of this morning I still cannot find my mistake(s). I believe it is a data binding mistake or incorrect data context.Some details about the view models involved:
DataFieldViewModel
...implements INotifyPropertyChanged and exposes properties for its (in this case a rectangle and a textbox) X,Y position, width, height, visibility, and selection status (a way to track it across several rubber band selection operations)
PageViewModel
...implements INotifyPropertyChanged, and has among other things an ObservableCollection of type DataFieldViewModel, called DataFields, and exposes it as a ReadOnly Property.Here's a look at MainWindow.xaml.vb and one of the broken subs:
Namespace EditorUI
'
' The main window of the editor.
[code]....
I am trying to modify the MethodParameter directly in the XAML. I do have a working example where I am setting it from code. Code version is:
Dim odp As New ObjectDataProvider()
odp = FindResource("Products")
odp.MethodParameters.Clear()
odp.MethodParameters.Add(CType(txtCatId.Text, Integer))
ObjectDataProvider defined in XAML looks like this:
[Code]...
Is there anyway I can retrieve the value of my textbox (which is bound to a separate ObjectDataProvider and put that in place of the hardcoded "0" currently in my XAML? I am looking to have this be completely XAML driven and have not been able to get it working without the code change.