|
|
I have a borderless window. A double click on it maximizes it - WindowState.Maximized and WindowStyle set to None.
Now I'm trying to get the proper size of that window so that I resize the internal controls.
My screen resolution is: 1280 x 800
SystemParameters.MaximizedPrimaryScreenWidth 1288.0 double
SystemParameters.MaximizedPrimaryScreenHeight 778.0 double
What are these two properties supposed to return actually? Why the width is larger than my screen and the other one smaller?
(on my screen visually the windows is OK)
---> Gets a value that indicates the height, in pixels, of a maximized top-level window on the primary display monitor.
---> Gets a value that indicates the width, in pixels, of a maximized top-level window on the primary display monitor.
???
Or
SystemParameters.FullPrimaryScreenWidth - 1280
SystemParameters.FullPrimaryScreenHeight - 744
What is the proper way to get the system metrics in WPF? Or there isn't one?
SystemParameters.VirtualScreenWidth
SystemParameters.VirtualScreenHeight
modified on Friday, August 14, 2009 7:15 AM
|
|
|
|
|
Hi,
How can I add dynamic image to the WPF Expander Control, so that, I can change it from the code behind.
I have created a CustomControl by inheriting the Expander control. I exposed a DependencyProperty named IconSource. I modified the HeaderTemplate by adding an Image.
Now my problem is, how can I change the source of that image inside the Header Template after the modification of the IconSource dependency property?
Can anyone please help me regarding that?
Regards,
- Kunal Chowdhury ( My Blog)
|
|
|
|
|
Can you bind the Image Source property to your IconSource property?
<Image Source="{TemplateBinding IconSource}"...
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
I want to upload large files means in size that of 10 to 15 mb
Can u help me how to do these
Er. Tarun Suneja
|
|
|
|
|
This is not a Silverlight problem. In the web.config file, you need the following section:
<configuration>
<system.web>
<httpRuntime maxRequestLength="nnn" />
</system.web>
</configuration> Set nnn to be the appropriate size in KB.
"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 am using Generic Handler for uploading content from my silverlight application.
I want to get notified as a file is uploaded successfully when multiple files are being uploaded to show a progress bar
|
|
|
|
|
It's with great pleasure that I announce the latest version of MoXAML Power Toys[^]. MoXAML now has the ability to translate your code from VB.NET to C# or vice versa, and to extract a user control directly from XAML.
"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
|
|
|
|
|
Cool....
Regards,
- Kunal Chowdhury ( My Blog)
|
|
|
|
|
Hi,
I have:
Class Persn with name and age props
class Manager with List<person> and event for any change occurs (name changed, person added to list etc.)
on the xaml.cs I have ObservableCollection with get to that list from manager. a listVier is bind to that observable
my problem is how to make the ui to refresh when that event of change is raised.
How can I implement that Observable and control the CollectionChanged?
thanks.
|
|
|
|
|
If u r using ObservableCollection & binded properly to the UI, then it will automatically refresh the UI thread as ObservableCollection automatically triggers INotifyPropertyChanged events.
So, no need to bother about it. Let me know, if you are facing any issue regarding the same...
(Please vote it as answer, if it helps you resolving the issue)
Regards,
- Kunal Chowdhury ( My Blog)
|
|
|
|
|
It sounds like you've got your ObservableCollection in the wrong place. You need to change the List in Manager into an ObservableCollection , so that add and delete events are raised appropriately. Basically, you've wrapped the List up in something that will never see the changes without you explicitly raising a notification, which seems to be a little bit pointless.
"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 have load a large set of data from SQL Server into a three level tree. It is taking long time to populate the tree.
Is there a way (e.g. lazy loading) to load only few records first and then load the rest of the records so that the tree area doe not remain empty for a long time.
|
|
|
|
|
The normal way to do this is to load all the items at the level you are at, and then add a dummy item to the level below. Then, when you expand your treeview you check to see if the first node below is a dummy node - if so, you remove it and attempt to retrieve data from the database that's a child of the expanding item.
"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
|
|
|
|
|
Have you tried using TreeView from Silverlight Toolkit? We can probably provide more helps if you are using Silverlight Toolkit.
Thanks.
Thanks and Regards,
Michael Sync ( Blog: http://michaelsync.net)
Microsoft MVP (Silverlight), WPF/Silverlight Insiders
|
|
|
|
|
Oh how I wish Silverlight 3 supported virtualization on hierarchical items.
"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 Thanks for reply. Yes we tried the Silverlight tree, but results are not encouraging. We are only loading few hundred records and most of them are at first noode. It is still taking un-acceptable amount of time.
Regards
Rajeev
|
|
|
|
|
I have a silverlight application,that communicating and getting data through socket communication.At each Receive callback i want to get data and update in the GUI at the moment itself.In this case sending and receiving data asynchronously,but the delegate for GUI updation in action only after all receive callbacks.How can i execute GUI updations sequentially with each callback?
|
|
|
|
|
You can call another service after completing of first call.
For example:
service.Call1Completed += (sender, e) => {
//Update the UI.
service.Call2Completed += (srd,e1) => {
//Update the UI.
};
service.Call2Async();
};
service.Call1Async();
Thanks and Regards,
Michael Sync ( Blog: http://michaelsync.net)
Microsoft MVP (Silverlight), WPF/Silverlight Insiders
|
|
|
|
|
My scenario is like this.
SocketReceiveCallback(object sender, SocketAsyncEventArgs e )
{
// read data from e.Buffer.
if ( dataReceived == TotalDataSize ) // checks of the complete reception of one image
{
// update the GUI using the received data.
System.Diagnostics.Debug.WriteLine( “ received image “ );
Dispatcher.BeginInvoke(new DisplayImageDelgate(DislayImageData), imageData); // imageData is a class containing the received data
}
Else
{
// call socket.receiveAsync() to get next set of data.
}
}
private void DisplayImageData (MyImageData data)
{
if (data.ImageStream != null)
{
BitmapImage bmp = new BitmapImage();
bmp.SetSource(new MemoryStream(data.ImageStream));
myReceivedImageCtrl.Source = bmp; //GUI update should happen at this point.
System.Diagnostics.Debug.WriteLine( “ Draw image “ );
}
}
Please note that my application, there is continues async requests to server ( corresponding to user action ) and server responds with a stream of image data( eg:- 100 images. The application needs to update the GUI immediately after each image is received ( even while the server streams the data). In the above case although the SocketReceiveCallback is getting the data continuously from server, the GUI update happens only after all the data receive is completed( which can take a long time ).
It seems that although the DisplayImage function is invoked using BeginInvoke, the system actually executes the display function at a later stage, causing ‘jumping’ image displays
The debug trace obtained was:-
received image
received image
received image
received image
Draw image
Draw image
Draw image
Instead of the needed
received image
Draw image
received image
Draw image
received image
Draw image
What could be done?
Thanks and Regards
JS
|
|
|
|
|
You can create one List and add the image data on completed event. and call the draw before receiving all data.
Thanks and Regards,
Michael Sync ( Blog: http://michaelsync.net)
Microsoft MVP (Silverlight), WPF/Silverlight Insiders
|
|
|
|
|
Dear all,
I've looked around to find an elegant solution to my problem, but not with a log of success...
I would like to prevent a control (custom label, custom button,...) from being rendered (drawn, painted.. ?) based on a condition (actually, a database linked security check)
but not by using the visibility or opacity properties as I would like to keep these properties freely usable by the users of the control in design mode.
I tried to override OnRender, passing a null drawingContext etc. but it doesn't work.
Does anyone have an idea how to do this ?
Thanks all!
|
|
|
|
|
You could always create an empty style for the control if necessary.
Apply a DataTrigger to apply this style based on your condition.
"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 investigated this, but how can I reset the style to the default one after ?
The process is quite like this:
public MyLabel()
{
SecurityHandler.Instance.SecurityChanged += new SecurityChangedEventHandler(Instance_SecurityChanged);
}
void Instance_SecurityChanged(object sender, string newUsername, int newSecurityLevel)
{
this.securityVisibilityCheck(); // Should change the style here so
}
Thanks for your quick reply!
|
|
|
|
|
When the condition triggering your data trigger is removed, the default style is automatically reapplied. That't the beauty of triggers - you don't have to write a lot of code to reset things when the condition is no longer true.
"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
|
|
|
|