|
You want to look in to silverlight, that's how you do WPF for the web.
Christian Graus
Driven to the arms of OSX by Vista.
"I am new to programming world. I have been learning c# for about past four weeks. I am quite acquainted with the fundamentals of c#. Now I have to work on a project which converts given flat files to XML using the XML serialization method" - SK64 ( but the forums have stuff like this posted every day )
|
|
|
|
|
Has anybody used these and got them to work?
I just get: The attachable property 'VisualStateGroups' was not found in type 'VisualStateManager'.
|
|
|
|
|
|
I did and came to the conclusion that I will get round to using themes when they are ready for non trivial apps.
Thanks.
|
|
|
|
|
I Have a requirement where i need to pass only sql select statement as a parameter to Service. Instead of writing query in the service i need to accept the query as a parameter.
Any suggestions, samples or links would be appreciated.
Thanks
|
|
|
|
|
You can't pass it as a string?
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Well an string would work but... that could be quite dangerous, it's quite easy to make injection attacks with that technique.
I would limit that free querying to the final user.
HTH
Braulio
/// -------------------------
Braulio Díez
DBSchemaEditor.com
Free Silverlight based DB Schema Modeling Tool
/// -------------------------
|
|
|
|
|
|
From the MSDN link,
"Used within the template of an item control to specify the place in the control’s visual tree where the ItemsPanel defined by the ItemsControl is to be added."
(stress on the underlined words)
One way to look at it is, it gives you a starting point to start looking out for your Items in the Visual tree. You know, they surely will be in the ItemsPresenter (i.e. if you follow the use of ItemsPresenter in your ControlTemplates)
|
|
|
|
|
So we ought to use ItemsPresenter just in a visual tree !
Sorry if I couldn't realize it well
|
|
|
|
|
It's one of the ways I see it. It would come handy if you need to parse the visual tree. With DataTemplating and the styling flexibility of WPF traversing the tree might turn daunting, but ItemsPresenter might rescue you.
|
|
|
|
|
Thank you ABitSmart.
As far as I know , we should use ItemsPresenter in DataTemplating !
Isn't it ?
|
|
|
|
|
ItemsPresenter is more of ControlTemplate thingy. Now, if I have confused you more, read here Link[^]
See this also Link[^]
|
|
|
|
|
Thank you for the responses
|
|
|
|
|
Have fun
|
|
|
|
|
Hello guys.
How can we minimize a WPF window with C# ?
Thank you
|
|
|
|
|
Like this,
this.WindowState = WindowState.Minimized;
where this is my Window object.
|
|
|
|
|
|
Appreciate the reply. Glad to be of help.
|
|
|
|
|
Hi,
There is a weird problem for which I will have to do some explanation on background.
I am working on a WPF client application which has about 3-4 usercontrols loaded, each having a listview displaying records using a observable collection. This observable collection is a collection of class instances that follow the INotifyPropertyChanged model. Upon each change in the collection the change reflects onto the listview column. Updates to existing rows in the collection keep streming in from the server using WCF TCP/IP at about 100-200 updates per second.
The issue is that once in a while the UI just freezes and then the no of threads attached to the process (seen in the task manager) keep on increasing exponentially.. I have no clue why this happens.. when i debug the updates are still coming in and observable collection is still getting updated.. but the UI hangs.. This does not happen always or on a particular action.
I am using Dispatcher.BeginInvoke when adding items to the listview but not when updating the properies of instances within the collection as observable collection automatically takes care of such updates. I am also using Virtualization in listview which is anyways enabled by default.
Any clues what could be causing this..
Pankaj Chamria,
Software Programmer.
|
|
|
|
|
Suggestions,
- The only thing striking from your description is, your object implements INotifyPropertyChanged. ObservableCollection inherently implement the change notification. You might want to try disabling the property change mechanism of the objects and just rely on the ObservableCollection.
- What DispatcherPriority do you set for BeginInvoke ? Did you try setting it to a lower priority e.g. Background ?
- Don't update the main Observable collection. Work on a different one and periodically replace the main one with the updated one. I don't feel good about this one though :>
|
|
|
|
|
Thanks for your reply.
I am using two collections. Collection A is a list of objects which implement INotifyPropertyChanged. It gets updated continuosly using a worker thread. Collection B is my observable collection hosted in the UI thread, which observes on Collection A elements. I used Normal priority. Using Background too causes this issue, although it occurs less frequently.
The issue seems to be with the wpf framework, although i am not sure. I found the solution to my problem on the following thread, which makes for a good reading.
http://social.expression.microsoft.com/Forums/en-US/wpf/thread/e55530dc-a358-4c6b-81b6-25a11c173a22/[^]
Now i let the background thread do the updations as fast as it wants to without raising the property changed events at that time, but i raise all the property changed events for all objects in collection from the UI thread on every 100 frames using the CompositionTarget.Rendering event. Now the hang problem is thankfully put to rest!
PS: You mentioned that even without raising the property changed events, my listview should get updated as I am using the observable collection. But I tested it out. It does not work without raising the PropertyChanged event, for my design of using 2 collections.
Pankaj Chamria,
Software Programmer.
|
|
|
|
|
The article was definitely a nice read.
You did not mention that you were working with 2 collections. The fine frequency of update would be causing WPF go bonkers, I sensed that and so provided you the third option.
I had faced something similar when WPF was beta. I needed updates as fast as 100ms with plotting on a WPF graph. The app just died away! Microsoft recommendation was wait for the 3.0 release having performance boosting. I settled with DirectX plotting finally.
It's great to know you've got things sorted out. Have fun :>
|
|
|
|
|
Can you offload any of the work to a Background Worker thread?
|
|
|
|
|
My searches are coming back with limited results, so I thought I would ask the question directly.
What's best in terms of components (DataGrid) or even framework (WPF) to use to develop a Windows desktop application the UI of which is primarily going to consist of two read-only data grids which needs to be updated in real time with data coming in from serial ports at a 10Hz rate?
Thanks in advance.
Siraj.
Siraj Podikunju
SP Consulting, Inc.
sirajp@spconsult.com
|
|
|
|