|
if you write your data in xml-format you will have a easy and portable solution.
Press F1 for help or google it.
Greetings from Germany
|
|
|
|
|
The c++ server already have a native c++ client, now we need to add a Silverlight client without any modification to the server.
The applications are biased to use minimal data transfer. so we cannot use xml ( which will also create changes in server )
Recreating the data byte-by-byte is possible at client, but we would like to know of other possible methods.
|
|
|
|
|
Here is the problem:
I have a DatePicker control (Framework 4.0) and once I delete the text in its textbox, a phrase "Enter text here" (enclosed in <> brackets) appears in a text box.
I need to get rid of it, so when the user deletes the text in a DatePicker's textbox, the textbox remains empty.
So far I've tried to examine DatePicker's code via reflector, but haven't found any clues.
Any help will be greatly appreciated.
|
|
|
|
|
Found this[^] thread. Could be of some help to you.
The funniest thing about this particular signature is that by the time you realise it doesn't say anything it's too late to stop reading it.
|
|
|
|
|
Hi Guys,
i want to do the styling in the C# area.. like as we do in the XAML.
for a button i have given the style in xaml and i need to give the same in C#..
Eg;
<Button Canvas.Left="559" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" Canvas.Top="515.403" Height="23.634" Width="59" FontFamily="./Fonts\#Verdana" FontSize="10" FontWeight="Normal" FontStyle="Normal" TabIndex="8" Name="Refresh" Click="Refresh_Click" Background="Transparent">
</Button>
here i have given the style as
Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}"
i need to give the same in C# as
Style style = new Style(typeof(Button));
---- here how to do that thing . can any body help.. thanks in advacne..
Refresh.Style = style;
|
|
|
|
|
Step 1: Creat Resource (Style) in your XAML code.
Step 2: Use method FindResource in C# code i.e.
Refresh.Style = (Style)FindResource("XYZStyle");
Parwej Ahamad
ahamad.parwej@gmail.com
|
|
|
|
|
How do we get the ASCII value of key entered in a silverlight textbox, using C#.
Reqmt : Disabling Ctrl +V in silverlight textbox
Request your attention
Thanks
Santhosh
Santhosh
|
|
|
|
|
See this thread[^].
The funniest thing about this particular signature is that by the time you realise it doesn't say anything it's too late to stop reading it.
|
|
|
|
|
WPF DataGrid and asp.net like editItemTemplate? Is it supported out of the box?
Thanks
dev
|
|
|
|
|
Yes it is. You get default editing templates in place, and you can provide your own by implementing your own CellEditingTemplate .
"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
|
|
|
|
|
I want to bind the Height of a ChildWindow to the Height of an element in the Page that shows the ChildWindow . The only descriptions I've seen are bindings between elements in the same Control . Is what I want to do even possible, and if so, what is the syntax of the Binding expression that would be in the ChildWindow ?
I first tried to set the Height of the ChildWindow to the Height of the element in the Page immediately after constructing the ChildWindow and before calling ChildWindow.Show , but for some mysterious reason, this positions the top of the ChildWindow above the top of the Page , which is unacceptable. Naturally I want to keep the ChildWindow centered on the page, or at least centered on a specific element within the Page .
|
|
|
|
|
Hi.
I have a UserControl in WPF.
The UserControl has a MouseLeftButtonUp event.
The problem is- the Window has a this.DragMove() method in its MouseDown event which seems to interfere with the MouseLeftButtonUp event in the User Control (I need the this.DragMove() method to move the borderless window).
If I call the dragmove method in the Window's MouseDown event, then if I click on the user control- the MouseLeftButtonUp event doesn't fire. But if I don't call the dragmove method- the MouseLeftButtonUp event works fine.
Any ideas? Thanks!
|
|
|
|
|
Since the first days of windows event programming it has always been a heirarchy for event processing that the form first, container second, contained controls next, controls in a container in the contained controls last....
The only way you can get away from that is not going to be clean.
On MouseEnter on your control, remove the DragMove event handler binding and put your mouse click event on.
On MouseLeave on your control, remove the left button event handler and put DragMove back on.
|
|
|
|
|
Hi,
How to code to set a background color for treeview node while the mouse pointer moving over it at run time.
Thanks in Advance
Ch Gayatri
|
|
|
|
|
Should be fairly simple - change the treeview style to set a background color (as an animation) on mouse move.
The funniest thing about this particular signature is that by the time you realise it doesn't say anything it's too late to stop reading it.
|
|
|
|
|
Have a look here[^] as well.
The funniest thing about this particular signature is that by the time you realise it doesn't say anything it's too late to stop reading it.
|
|
|
|
|
still i did not get the solution for this..
|
|
|
|
|
Hi All,
I've been living a lie!
I thought that using this in XAML
DataContext="{Binding RelativeSource={RelativeSource self}}"
Would ALWAYS point to the .xaml.cs code behind file ... hmm, how wrong!
|
|
|
|
|
Jammer wrote: Would ALWAYS point to the .xaml.cs code behind file ... hmm, how wrong!
Yup. RelativeSource.Self allows you to point one property to another property on the same element, e.g.
<TextBlock Width="{Binding RelativeSource={RelativeSource Self}, Path=Parent.ActualWidth}"/>
"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
|
|
|
|
|
|
Never starts in my case.
"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
|
|
|
|
|
Oh give over!
|
|
|
|
|
Dear friends
i have an doubt,
i have Page 1,Page 2 and view model for both.
now i have button in page 1 that is bound to a command
and now when i click that button it goes to view model command (and now here i want to open the second screen but second screen in view)
tel me how to access view objects in view model?
any idea? link?
by
Joe.I
|
|
|
|
|
Joe - it's generally considered to be a bad idea to put knowledge about a view into the viewmodel. This can cause you problems when it comes to testing your VM code because you now have an implicit link to a UI object in place. Saying that, this is a guideline not a hard and fast rule - if you can't get an alternative approach to work and you end up contorting yourself through all sorts of hoops then just do what you need to do.
However, one approach that I like is to use typed DataTemplates and let the binding engine take care of creating the relevant objects for me. Josh Smith explains it brilliantly in his MSDN article here[^]. Take a look at the section "Applying a View to a ViewModel" to get an understanding of how it all works.
"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
|
|
|
|
|
I don't mean to be rude, but if you are trying to access your view in your VM, then your OOP skills need some refactoring.
To try and be not such an ahole...I think what you are saying is that you have a view that contain another view and they share a VM. The main view we can call V1 - the subordinate we call V2. I'm guessing your V2 is simply not visible. In this case, you want to bind the visibility to a property on your VM (like IsOrdersLoaded or something) and use bool2invis converter. When you command fires, it should simply set this property to true (and your properties setter should call OnPropertyChanged("IsOrdersLoaded")).
On the other hand - if you are trying to "inject" V2 into V1 (or anywhere else in your layout) and it needs to be dynamic (i.e. the command operation knows what V2 should be) - then you should consider basically the same approach, but your V1 (or whatever else) should contain a ContentPresenter that is capable of taking content as a view. This gets a bit trickier when using Commands since they don't return anything - and the one excpetion to the rule (imo) where View Models "know" about views. Essentially your content presenter's content is bound to a property on your view model via a property something like ...
internal FrameworkElement SubContent { get { return this.subContent; } set { this.subContent = value; OnPropertyChanged("SubContent"); } }
and this command of your's simply executes to instantiate your new view and sets that view to this.subContent. Visibility of the content presenter should be implemented as a "is content null" kind of value converter.
Honestly, I personaly hate this approach - I much prefer command repositories that are decoupled from my MV (so the command itself isn't even in the MV) - makes much more sense for testing when I can spin off views from unit tests and have nothing to do with my V1 or MV. If you went this direction, however, you need to add OnCommandExecuted<t> type events to your own command infrastructure to capture the T and propegate back up to the code-behind in the view, which simply sets this.V2Container.Content = T.View type of thing.
I hope that helps a little? If you can be a little more clear about your use case, I can certainly be more helpful.
-dec
|
|
|
|