Maybe data flow isn't the right question, maybe application organization describes my quandary a little better. Here is what I am trying to do and could stand a bit of help getting there.
The app I am creating basically sits between two pieces of equipment and provides data management and communications management between the two. On one side is a piece of equipment that views its world as dealing with a single entity that provides a go no-go result. The other side is a piece of gear that can have of measurements to keep up with. Essentially all this data must be gathered, analyzed and a go no-go be sent. One side expects a TCP/IP server the other is a GPIB bus master. The comms are handled as that was the easy part.
Where I am a bit stuck is gluing all this together. The GPIB code and the logic to handle the data is done and runs as a task. The TCP/IP server is done and it runs as a task. I need to add one more piece of logic to handle the decision making plus have a UI that needs to be kept up to date.
Right now I have test programs for testing the comms etc. There I have the UI registering event handlers to get notifications of something happening. I use EventWaitHandles to notify the thin interface layers that sit about the comms. All works great! But when I put all this together..............???
I want areas of functionality as loosely coupled as I can for better reuse. In the UNIX world this is simple but in this world, not so much. My inclination is let the MainWindow code behind kick off each task and the tasks expose public methods or permit registering event handlers. But something about this doesn't feel right. In the UNIX world I would have started POSIX threads to handle each functional area and used message queues to facilitate data flow. That way synchronous functionality is grouped and asynchronous is grouped. But the Windows world doesn't seem to operate that way. What I have seen is all the classes/objects are gathered into a single app and there is a lots of "peeking" over the wall to do things which I think tends to make things very tightly coupled.
After a quick view, I see two things:
After calling the ctor of ViewModel, there will be Ivan, Stefan, Maria and Michael in the Persons collection. After calling ViewModel.Add() there will be only Maria and Michael, because you create a new collection.
class Person needs to implement INotifyPropertyChanged and after changing a property it has to call the PropertyChangedEvent.
i am building Kinect Application, obviously using WPF.. Now i have a problem with Navigation. I have a Window and others are Pages that will use a Frame in a Window. So the Window has Button to Main to the "Menu" so the Page that contains Menu's is called "MainMenu.xaml"
now when i navigate to the Menu Page , it shows my Menu page ,but the Window Button is not hidden.
So Before i used to have the code to navigate to the "MainMenu.xaml" in the loaded event of the Window so that it directly moved to the Menu, but my Problem is that still behind even if its behind my Kinect Gesture can click or touch the menu's in the "MainMenu.xaml" it looks like they are not out of scope.
When i move from **MainMenu.xaml** to the selected menu page i do it this way
(Application.Current.MainWindow.FindName("_mainFrame") as Frame).Source = new Uri("/Alphabets101/Menu.xaml", UriKind.Relative);
but still you will see that it tries to Access a "MainMenu" even if they are not visible on the screen
Spoted in Daniweb-- Sorry to rant. I hate websites. They are just wierd. They don't behave like normal code.
This is wat i wanted to do. But as the main thread is very busy it wont show the progress window i know. I used the background worker and showed the progress bar.. But the thing is i have different business logic which will work based on the users clicks.. so i may need to create different workers for handling those.
If i do something like above mentioned window as progress window i can commonly use the same for all places.
Hence request your help here my friends.
thanks in advance.
And you are right i am doing in the back ward only.
But the thing is, I have more the 20 forms in my application which have different functionality. And even in single form i have more than 5 buttons which will do different business logic's. So that is reason i wanted to do this approach, other wise i need to create separate background workers for all buttons or single background worker with different parameters.. which is more messy.
So i planned to have a separate progress window which can be accessed across all the forms.
But as we know both are in same thread causing issue. i planned to open and use the new window in different thread.
Try looking at the BackgroundWorker class. It provides an encapsulation for a worker thread that supports passing updates to the UI taking care of all the dirty cross-thread marshaling. It is very easy to use and supports aborting as well.
As for your progress window, you need to raise it when the first background thread is started and close it when the last background thread ends. You may want to consider creating the form at app startup then setting all of the thread progress notifications to call a notify update method on the form. The form could then determine if it needs to show/hide and which thread(s) progress to show. Again, if you use a backgroundworker, there is a thread complete event which fires when the thread is done making it easy to do something "on the way out the door". The progress window should be event-driven... only responding to events raised by the worker threads.
Hi! Began studying wpf. Versed with custom control'ami. I create the control (simple button) from Control.
The question is - is it possible to not draw method OnRend (such as they call it), and make the template, the file generic.xaml? And still do not understand why does not my click handler.
publicclass MyButton : Control
publicstaticreadonly RoutedEvent MyClickEvent;
DefaultStyleKeyProperty.OverrideMetadata(typeof(MyButton), new FrameworkPropertyMetadata(typeof(MyButton)));
MyClickEvent = EventManager.RegisterRoutedEvent("MyClick", RoutingStrategy.Bubble,
publicevent RoutedEventHandler MyClick
We have an application portal where a user can logon and launch any of our applications they are authorised for. Currently this is written in ASPX launching Silverlight applications.
We now need to extend this to launch Excel workbooks but also to integrate the launcher with a control application. I would like to do this in Silverlight as that is where our skill set is and I REALLY like the browser deployment method. Silverlight out of browser may be an option (is it still available in SL5) but does that then require a different deployment method.
We have the xap and file locations and we assume the user has access to the network drive the Excel workbook is stored.
The question is whether it is possible for a user to launch Silverlight apps and Excel workbooks from within a Silverlight app.
Never underestimate the power of human stupidity
I have a class "Files" that creates txt files, i want the progress bar and the multiline textbox in the xaml shows the process when its occurs.
I receive all the paramates at the MainWindows.cs and i see the progressbar1.value growing and the textbox1.text having the desired text but in the gui nothing happends.
Hello, I've managed to setup an example working for both RoutedEvent and AttachedEvent but it appears the difference between the two is just syntactical as "RoutedEvent" handler can be declared in XAML in same syntax as "AttachedEvent". (I understand the difference between AttachedProperty vs DependencyProperty clearly)