|
Am I right in understanding that the bitmap was visible but did not change when you updated the bitmap?
I tried using a MemoryStream and only got it to change by recreating the BitmapDecoder and setting the ImageSource each time, even though it was set not to cache the result.
I also tried using WriteableBitmap in that case just changing the ImageSource on the ImageBrush was enough for it to update. The WriteableBitmap class is improved in 3.5 sp1 and allows access via pointers (don't for get to use AddDirtRect). You can also just write the whole array if you want.
If your not not updating the bitmap I may have misunderstood, if it doesn't show up at all I would check the texture coordinates and test by setting the BackMaterial to a SolidColor. You may also want to check if any of the materials, images e.t.c are Frozen.
|
|
|
|
|
thank you very much! You did understand me right, it just wasnt updating The WriteableBitmap is the solution ;]
|
|
|
|
|
Hi all,
I m new to WPF. I m developing one application in which i want to read XAML file and iterate thru each control element and find the name and value of that control and write to another xml file.
So kindly need yr suggesion..
Thanks
Krishnraj
|
|
|
|
|
the class XamlReader let's you read the root element from a xaml file (with Read method)
then you could iterate thru the logical tree using LogicalTreeHelper
Good Luck
|
|
|
|
|
Hi yanairon,
Thank u very much for replying
OK Now i got the idea.
Again Thanks
Rana Krishnraj
|
|
|
|
|
Hello,
I would like to set the object as a startup object in WPF. Normally, we used to use "this.StartupUri" for that. but I have to use the Uri of XAML file here. I don't like that. I want to set like this.Startup = new MyView(); in App.
Any idea?
Thanks in advance.
Edit: My WPF project should be XBAP-compatible. So, I can't use "Show()" or "Run()" method....
|
|
|
|
|
Michael Sync wrote: this.Startup = new MyView(); in App
Would the Application.MainWindow property work for you?
Why is common sense not common?
Never argue with an idiot. They will drag you down to their level where they are an expert.
Sometimes it takes a lot of work to be lazy
Individuality is fine, as long as we do it together - F. Burns
|
|
|
|
|
Wes Aday wrote: Would the Application.MainWindow property work for you?
I just tried but not working. It doesn't show anything on the screen unless we call "Show". But I can't use it "Window" class in Xbap..
I'm not sure why we don't have this.Startup or this.StartUpObject even we have this.StartupUri.
|
|
|
|
|
Hi Michael,
You would need to modify app.g.i.cs file.
Then find StartupURI property of application and modify as:
this.StartupUri = new System.Uri("Window1.xaml", System.UriKind.Relative);
Hope this helps.
Vinay
ComponentOne LLC.
www.componentone.com
|
|
|
|
|
Vinay Srivastava wrote: this.StartupUri = new System.Uri("Window1.xaml", System.UriKind.Relative);
Actually, we would like to use with Unity framework.. I have successfully ported Unity framework for Silverlight.. I want to use the code below at that startup..
this.Startup = container.Resolve<shell>();
How can I do that?
In Silverlight, we can do like that..
private void Application_Startup(object sender, StartupEventArgs e) {
IUnityContainer container = new UnityContainer()
.RegisterType<ILogger, TraceLogger>()
.RegisterType<IStoplightTimer, RealTimeTimer>();
this.RootVisual = (UIElement)container.Resolve<StoplightView>();
}
Ref: http://michaelsync.net/2008/07/11/unity-application-block-unity-for-silverlight-and-stoplight-quickstart[^]
|
|
|
|
|
Hello friends...
i have a listview filled with data in it .
and i have a textbox with some string in it.
how can i find that string in the listview and color that particular cell.
can you help me out..
cheers
chandu
|
|
|
|
|
You could try binding the background brush to the textbox and use a custom converter that receives as a parameter the string from the cell.
Mihai,
|
|
|
|
|
|
Good afternoon colleagues:
I have a tricky question, on which even Microsoft's evangelist could not provide a clear solution.
I want to compare performance of WinForms and WPF rendering models.
For that purpose I measure time span between content update event and rendered event.
In WinfForms the operation is very straight forward, cause there is an OnPaint event. But in WPF I cannot find an analog of this event.
Certainly, the rendering model in WPF is totally different, thus refresh of the data is performed somehow in another way.
So, to be more precise, I want to know when actually the content appears on the screen.
I have conducted some research and there is seems to be a Load event, which serves for this purpose, but this event is fired only once on application start up.
Perforator somehow measures rendering time. But it doesn't use WPF for that purpose, but WinAPI.
Thanks!
/LOOM
|
|
|
|
|
|
Hi Mark!
I have already seen this document. Probably, need to address it again.
BTW, on the Microsoft's forum I was recommended to use RenderSizeChanged event. Will try it an get back later.
Thanks!
/LOOM
|
|
|
|
|
Hi again!
I created an UserControl which is a singleton.
public partial class DeepDisplay : UserControl
{
private static DeepDisplay instance;
private static object lockObject = new object();
private DeepDisplay()
{
InitializeComponent();
}
public static DeepDisplay GetInstance()
{
lock (lockObject)
{
if (instance == null)
instance = new DeepDisplay();
}
return instance;
}
}
What I want to do is to add this UserControl in the XAML Part of the code.
<local:DeepDisplay x:Name="deepDisplay" Width="Auto"></local:DeepDisplay>
Due to the fact that the Constructor is private, I need to call the GetInstance Method instead.
Can this be done easily and if so, can someone be so kind a show me how?
As always thank you in advance,
eza
|
|
|
|
|
I'm quite sure that is impossible.
Anyway, a singleton control sounds like a very bad idea. First of all why would you need such a thing? Seccondly, how would you expect it to work when you add a seccond "instance" of the control? I'm asking this because a control can only have one parent, so it can't be in to places at once.
On the other side, if you want to make sure that the control is only used once, you could keep track of the number of instances created in a static variable, and throw an error when another instance has already been created.
Mihai,
|
|
|
|
|
hi,
I have a result set form the database stored in the ILIST. I want to bind this to a listview[in which i use grid view]. Does any one have a solution for this ..if, plz help me
|
|
|
|
|
|
Hi All,
I feel like I should know the answer to this by now but I'm stuck.
I have a number of combo boxes in the UI, the contents of one is dynamic based on the selected item of another. All the comboboxes are bound to OberservableCollections created in a static ComboBoxManager class.
Whats the best way of handling the selection changing in the first combobox in order to populate the second combobox with the correct contents?
How do I get this selection changed event into this other class? Do I have to register a custom event in the ComboBoxManager class? Or can I create a 'Selection' property on the ComboBoxManager class and bind the first comboboxes selected item to it in a two way binding to this property and add a handler to this property to kick off some code when it changes?
Or is this all a bit overkill and I just need to use a RoutedEvent listener in the ComboBoxManager class??
Jammer
Going where everyone here has gone before!
My Blog
|
|
|
|
|
Hi All,
I've just created a small expample solution showing what I'm trying to do. I want to keep all the code out of the Window1 class basically whilst pointing the comboboxes to the event hander in the ComboBoxManager class. You can get the solution here:
EventRouting.zip[^]
Any input on this would be really appricated.
Jammer
Going where everyone here has gone before!
My Blog
|
|
|
|
|
Jammer mate. The answer to your problems is here[^].
|
|
|
|
|
Hey Fella,
Ahhh! Josh Smith ... you know what's crazy thing ...
The application I'm working on for my employer uses Dan Crevier's DM-V-VM models extensively. We've also wrapped up the access to each data model (one per screen in the app) in a plug-in architecture where everything communicates through interfaces making it all really modular. Two developers can work on the contents of two screens without ever going near each others code/implementation. Its a really neat solution.
For my app (of which you are very aware! I started out thinking that this was a tad overkill. How wrong was I? I've only scanned this Josh Smith article so far ... methinks I need to down tools and have a rethink ...
Thanks chap.
Jammer
Going where everyone here has gone before!
My Blog
|
|
|
|
|
If I can give any advice, it's read Josh's article on MVC and his Podder series. When you get your head round those, you finally say - "Damn it. I get it now. Now I know why I should be doing things this way in WPF." The MVC article, for me in particular, was the missing piece - the bit I needed to get it all working in my head (well, that and thinking about WPF from an ASP.NET point of view - take a look at my article on WPF if you want to see what I mean).
|
|
|
|