|
Check this, http://forums.silverlight.net/forums/t/5941.aspx
April
Comm100 - Leading Live Chat Software Provider
modified 27-May-14 21:44pm.
|
|
|
|
|
Hello,
While creating a WPF application, I am facing issue with the WPF window style. As per requirement, I have to design the customize Control box (other than the default blue and the close/ min/ max/ restore button) but not able to do that.
Another way is by hide/ remove the ‘control box’ from the WPF window and add the head section on it. I can able to do that using the WPF window property WindowStyle = none.
But that hides the windows XP Taskbar too. Please suggest me that how can I implement that.
Regards
Manish Mukatimodified on Wednesday, February 17, 2010 12:50 AM
|
|
|
|
|
OKAY -- I've done a ton of searching and I've not found anything that can directly help me with what I need to do.
I'm building a business application with Silverlight 3.0 and I'm down to my VERY LAST issue!
I have 3 ComboBox controls (building, datacenter, locationType) where datacenter has a dependancy on building.
I have a listbox with customers (works great).
When a customer is selected, a list of existing locations is populated. (works great)
For these (and other) populated controls, I put out a message "loading...blah blah blah" then when the data comes back I display "data loaded...blah blah blah" which works great.
I've got my datacenter dependancy working great as well. Pick a building and the correct set of datacenters is loaded.
My editor fields are wrapped in a grid and a datasource for my location object was created. I populate it in my code by setting editorContainer.DataContext = selectedCustomerLocation; editorContainer is the grid that wraps all of my editor controls. Each control that edits the fields of the control is bound to the datacontext of the grid, but Expression does not seem to place the parent object name as a fully-qualified name. (example my xaml says 'BuildingNumber' instead of CustomerLocation.BuildingNumber) I expected the editor controls to self populate with the data once DataContext was set. (doesn't work)
I also want each combobox to display the correct selected item. I know I need to say SelectedText = "{Binding {fieldName} Converter=myValueConverter, ConverterParameter= ....". I also expected that in the Convert logic I perform the linq to lookup the building enumerated object and return the text value for the integer returned in the customer location object.
Not quite sure how to explicitely pass to the converter the value of the building ID (for example) AND the list of building name/values to have it return the correct text. So this is the first question which is the syntax to pass parameters into the converter?
The second question, then, is Expression put the datacontext in a self-contained location within the grid followed by my fields. Do I have to extend the <datacontext> end tag to wrap my editor controls? Or is DataContext all wrong? I think I saw one guy use Data Template???
Any help at all would be great. I found a ton of examples but all of them are either too simplistic (working with internal collections statically created and never dealing with an externally selected object to bind with) or buried within the context of a DataGrid which I'm not using.
modified on Monday, January 4, 2010 4:53 PM
|
|
|
|
|
Michael Eber wrote: SelectedText = "{Binding {fieldName} Converter=myValueConverter, ConverterParameter=
A trick I used to pass multple values (my entire collection) to the converter was to not bind to the field name. Try this - SelectedText = "{Binding Converter=myValueConverter, ConverterParameter= ....".
Michael Eber wrote: The second question, then, is Expression put the datacontext in a self-contained location within the grid followed by my fields. Do I have to extend the end tag to wrap my editor controls? Or is DataContext all wrong? I think I saw one guy use Data Template???
Not quite sure I understand your question. However, IMO, the datacontext looks fine. DataTemplates are used to specify the visual structure of a data object, so DataContexts and DataTemplates are actually two different things (used differently).
There are only 10 types of people in this world — those who understand binary, and those who don't. |
|
|
|
|
|
What I mean as far as passing data to the converter is this:
I need to pass the collection of objects that populate the dropdown box.
I also need to pass the value set by the object.
I've seen a setup like this for passing a date: ConvertParameter=0\d\ But I have no idea what that means or how they are actually passing the date field.
|
|
|
|
|
Michael Eber wrote: ConvertParameter=0\d
AFAIK, ConvertParameter does not support binding. So, you can only pass 'hardcoded' values like 0\d, which will format your date. The date is passed using the binding value e.g. Text="{Binding myDate, Converter={StaticResource myConverter}}" .
However, the entire collection can be passed into the converter. The appropriate value(s) can then be used inside the converter to construct the value you want to display in your UI.
There are only 10 types of people in this world — those who understand binary, and those who don't. |
|
|
|
|
|
Hello,
I'm studying for the WPF exam and playing with the different setting in the GridSplitter control and one of the behaviours makes no sense to me.
Here is the XAML:
<Grid Name="grid1">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="100" />
<ColumnDefinition Width="5"/>
<ColumnDefinition Width="173"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition />
<RowDefinition />
</Grid.RowDefinitions>
<ListBox Name="listbox1" Grid.Column="0" SelectionChanged="listbox1_SelectionChanged"></ListBox>
<GridSplitter Name="gridsplitter1" Margin="0" Width="5" Grid.Column="1" Grid.RowSpan="2" ResizeBehavior="PreviousAndNext" HorizontalAlignment="Left" VerticalAlignment="Stretch"/>
<RichTextBox Grid.Column="2" Name="richtextbox1" />
<TextBox Grid.Column="0" Grid.Row="1"/>
<TextBox Grid.Column="2" Grid.Row="1"/>
</Grid>
When I use the splitter it resizes the previous column (0) but not the next (2), it just trundles across the window not changing size.
I know I can get the desired behaviour by just changing the third column to a proportional size but then it's the proportioning that is changing the column size not the splitter (and I'd get the same result if I put it back the ResizeBehavior to the default "BasedOnAlignment").
What am I missing here? Or is there no point to the PreviousAndNext setting?
Thanks,
Robert.
Robert
|
|
|
|
|
You have an absolute size for the last column. This size will be retained when you attempt the resize, hence the "move". Change it as follows:
<Grid Name="grid1" Width="278">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="100"/>
<ColumnDefinition Width="5"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition/>
<RowDefinition/>
</Grid.RowDefinitions>
<ListBox Name="listbox1" Grid.Column="0">
</ListBox>
<GridSplitter
Name="gridsplitter1"
Width="5"
Grid.Column="1"
Grid.RowSpan="2"
HorizontalAlignment="Left"
Margin="0"
VerticalAlignment="Stretch"
ResizeBehavior="PreviousAndNext"/>
<RichTextBox Name="richtextbox1" Grid.Column="2"/>
<TextBox Grid.Column="0" Grid.Row="1"/>
<TextBox Grid.Column="2" Grid.Row="1"/>
</Grid>
In order to see the effect, I limited your grid width to 278.
"WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys | Onyx
|
|
|
|
|
Yes, I know about the using the * for the last column but I have two points of confusion with this.
1) The first column has an absolute size but it has no issue resizing that.
2) If we are going to set the 3rd column width to * we might as well go with the default ResizeBehavior of BasedOnAlignment as we will get exactly the same behaviour - hence why I wonder if PreviousAndNext has any purpose.
(I've explicitly set the ResizeBehavior but could have omitted it as BasedOnAlignment is the default):
<Grid Name="grid1">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="100" />
<ColumnDefinition Width="5"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition />
<RowDefinition />
</Grid.RowDefinitions>
<ListBox Name="listbox1" Grid.Column="0" SelectionChanged="listbox1_SelectionChanged"></ListBox>
<GridSplitter Name="gridsplitter1" Margin="0" Width="5" Grid.Column="1" Grid.RowSpan="2" ResizeBehavior="BasedOnAlignment" HorizontalAlignment="Left" VerticalAlignment="Stretch"/>
<RichTextBox Grid.Column="2" Name="richtextbox1" />
<TextBox Grid.Column="0" Grid.Row="1"/>
<TextBox Grid.Column="2" Grid.Row="1"/>
</Grid>
Actually even if we use "BasedOnAlignment" but change the 3rd column back to an absolute width and set the HorizontalAlignment to "Right" it still won't resize the 3rd column, it just moves it across again. I can't see why there should be a difference in the behaviour (beyond which column is targeted) between setting the alignment to left or right.
|
|
|
|
|
Have a look at what happens if you add a second splitter. It's a bit of fun:
<Page xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<Grid Name="grid1">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="100" MinWidth="100"/>
<ColumnDefinition Width="5"/>
<ColumnDefinition Width="173"/>
<ColumnDefinition Width="5"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition/>
<RowDefinition/>
</Grid.RowDefinitions>
<ListBox Name="listbox1" Grid.Column="0">
</ListBox>
<GridSplitter
Width="5"
Grid.Column="1"
Grid.RowSpan="2"
HorizontalAlignment="Right"
Margin="0"
VerticalAlignment="Stretch"
ResizeBehavior="PreviousAndNext"/>
<GridSplitter
Width="5"
Grid.Column="3"
Grid.RowSpan="2"
HorizontalAlignment="Right"
Margin="0"
VerticalAlignment="Stretch"
ResizeBehavior="PreviousAndNext"/>
<RichTextBox Grid.Column="2"/>
<RichTextBox Grid.Column="0" Grid.Row="1"/>
<TextBox Grid.Column="2" Grid.Row="1"/>
<RichTextBox Grid.Column="4"/>
<TextBox Grid.Column="4" Grid.Row="1"/>
</Grid>
</Page>
"WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys | Onyx
|
|
|
|
|
Hi All,
I need to create a editable Workflow in run time.
Is is possible?
Please help me with this.
Thanks in advance.
Ramkumar
("When you build bridges you can keep crossing them. ")
http://ramkumarishere.blogspot.com
|
|
|
|
|
Hmm Interesting... Well I would use reflections. Does it need to be a graphical work flow? If so there is a nice WPF Work flow front end here on CP that would work for the graphical front end. I am using it in a 'Visual Power Shell' article...
Here is the link to the work flow designer...
WPF Diagram Designer - Part 2[^]
|
|
|
|
|
for example i want to animate the width of grid from 0 to its Auto Value! i've searched alot but cannot find anything, thanks in advance!
|
|
|
|
|
You will have to apply a resize animation.
Check this out[^].
There are only 10 types of people in this world — those who understand binary, and those who don't. |
|
|
|
|
|
Hi everybody.
I'm gonna create a ListView in WPF like below image via XAML and C#
http://xs.to/image-A835_4B3EF7EE.jpg[^]
I've already read some articles like this one[^] , but I'm a little confusing.
Could you please guide me , how I can do it ?
Thanks.
|
|
|
|
|
I am trying to develop a quiz application for the children using WPF and Expression Blend. What actually happens in the quiz is the textblock with the question hovers in the screen for certain time and the children have to click the correct answer of this Multiple choice question. After that certain time the question and the multiple choice answer options has to be updated from the XML data source.
Using the concept of data context I have data bind the XML with the UI but I could not yet dynamically bind to it. Any help would be highly appreciated.
Thank you in advance.
|
|
|
|
|
Take a look into using the Model View ViewModel (MVVM) pattern. There are lots of links on Google about using MVVM in WPF.
"WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys | Onyx
|
|
|
|
|
anishshrestha wrote: Using the concept of data context I have data bind the XML with the UI but I could not yet dynamically bind to it.
What do you mean by "dynamically bind to it"?
Programmatically you can create a Binding object, set its properties
as needed, and then set the binding to the property on the element:
Binding binding = new Binding();
binding.XPath = "Name";
myTextBlock.SetBinding(TextBlock.TextProperty, binding);
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
For the application, Actually I wish to move to the next question from the XML node as soon as a the time limit is up and so the options for that particular question. I seem to have no idea how to accomplish that in code.
How is it possible to bind the different node of data from the XML, one at a time,for a same control after the certain time gap???
Thank you for the response. I would appreciate any help or suggestions.
Thank you.
|
|
|
|
|
Hi,
In my applcaiton,i make Grid of size Grid Width="1300.441" Height="80",
Its working fien in this resolution.But when i changed my resolution to 1152 width,quater of application get out of the desktop.
How can i avoid that?
I want to display full page in all resolution.
Pls help me
Anu
|
|
|
|
|
Anu_Bala wrote: How can i avoid that?
Don't use hard-coded dimensions.
Instead, use an element that sizes the Grid.
For example, if the Grid is the child of a Window element,
you could set the Window's WindowState to Maximized and the Grid
will fill the Window's client area.
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Hi friends,
I am new to silverlight. I have created a silverlight combo with options 'Male' and 'Female', and included it in an aspx page.
Now I want to know, how to retrieve the selected value and selected text in aspx code.
Please help me.
Shivanandan C V
|
|
|
|
|
Shivan Nandan wrote: how to retrieve the selected value and selected text in aspx code.
aspx code runs on the server and Silverlight runs on the client.
You can use javascript on the client to communicate with a
Silverlight plugin.
HTML Bridge: Interaction Between HTML and Managed Code[^]
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
You can use javascript. Detailed info can be found at:
http://pietschsoft.com/post/2008/06/Silverlight-and-JavaScript-Interop-Basics.aspx
April
Comm100 - Leading Live Chat Software Provider
modified 27-May-14 21:45pm.
|
|
|
|
|
Hi,
I have a list of locations, I want to use google map for routing thro' the locations to find the shortest path, get directions and see street view using google API. This a wpf application, I am downloading locations from server.
As far as possible we don't want to use WebBrowser control.
Is there any way to do this? Any help or related link will be greatly appreciated.
Thanks!!
Happy new year
Veena
|
|
|
|