473,388 Members | 1,468 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,388 software developers and data experts.

WPF user controls interacting with each other

Eps
Hi,

I am writing an mp3 player using wpf, I have three user controls (media
library, media controls and a playlist). Obviously I need these to
interact with each other, I assume the best way to do this is to use
events right ?.

Can I raise an event on one user control and have one of the others
suscribe to it ? or do I need to have the main window suscribe to it and
then pass the message on to the target user control ?.

Any advice appreciated.

--
Eps
Dec 27 '07 #1
3 4012
Hello,
I am writing an mp3 player using wpf, I have three user controls
(media library, media controls and a playlist). Obviously I need
these to interact with each other, I assume the best way to do this is
to use events right ?.
I don't think the controls should be interacting with each other at all.

Besides the controls, the program should have a data model — some kind of
data structures for the media library, one section of which represents a
playlist, and the current status of the player. The controls reflect the
current state of the data model by the means of databinding, and they change
the model with databinding and commanding. They do not have to know anything
of each other, or of the window they belong to.

(H) Serge
Dec 27 '07 #2
Eps
Serge Baltic wrote:
I don't think the controls should be interacting with each other at all.

Besides the controls, the program should have a data model — some kind
of data structures for the media library, one section of which
represents a playlist, and the current status of the player. The
controls reflect the current state of the data model by the means of
databinding, and they change the model with databinding and commanding.
They do not have to know anything of each other, or of the window they
belong to.

(H) Serge
I have a datable in the medialibrary control that contains (amongst
other things) the path of every song. Are you suggesting I create a new
object which encapsulates the datatable as well as exposing more
properties (like the play/pause/stop status and the current song, etc.)

I guess all the controls could then just bind to relevent properties of
the object.

I have played about a bit with data binding, how do you go about binding
to an objects property ?.

--
Eps

Dec 27 '07 #3
I have played about a bit with data binding, how do you go about binding
to an objects property ?.
Maybe you could watch:

http://windowsclient.net/learn/video.aspx?v=6886 and
http://windowsclient.net/learn/video.aspx?v=6885

and there a lot more interesting topics :)

HTH

Bart
Dec 27 '07 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Dan | last post by:
Is it possible to access controls on other forms when using managed C++? In VB, it was a simple matter of declaring the form as global, but this is apperently not possible when using managed code....
1
by: Robert Howells | last post by:
Perhaps I'm just too new at this to pull it off, or perhaps it's just bad architecture. I'd appreciate some feedback on the the wisdom (or lack thereof) in attempting the following: I'm not new...
9
by: TCORDON | last post by:
I have a user control that contains 2 image buttons, when you click one of them, both must change the image source, the thing is that the first time you click any one of them the page appears to do...
2
by: tshad | last post by:
User VS 2003, I would like to use User Controls to control the page look with 3 User Controls (...PageTop.ascx, ...NavigateTop.ascx and PageBottom.ascx). I would put the Content User control...
8
by: mark.norgate | last post by:
I've run into a few problems trying to use generics for user controls (classes derived from UserControl). I'm using the Web Application model rather than the Web Site model. The first problem...
9
by: Gummy | last post by:
Hello, I created a user control that has a ListBox and a RadioButtonList (and other stuff). The idea is that I put the user control on the ASPX page multiple times and each user control will...
9
by: abprules | last post by:
Can somehow tell me the best way for multi user development to occur in MS Access? The situation is: We are creating a new database for a small company. There are 2 of us who want to...
1
by: Greg Stevens | last post by:
Here is the situation. I'm developing an application where: I have defined a class (DBClass) to provide an abstraction layer for interacting with a database. When an instance of the class is...
1
by: =?Utf-8?B?SlA=?= | last post by:
I have a default.aspx page. Default.aspx has placeholders. ASCX user controls are loaded into these placeholders at Page_Load. Each user control has a MultiView, within that there are two views...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.