473,732 Members | 2,175 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 4033
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
1880
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. How does one modify or read control properties when the scope of the form is limited to the function level? I need to have several forms open at the same time and all interacting with each other.
1
2134
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 to programming, but I am new to ASP.NET and Web application design in general... loved the concept of user controls and dynamically adding them to a page. So what I wound up with was an application that dynamically loads two user controls directly...
9
2892
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 a postbak, but the image source or the image displayed does not change until I click one of the images a second time, why dows it take 2 clicks for the user to "refresh"? TIA!
2
1861
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 between the NavigateTop and PageBottom User controls. These files be something like: sdhcPageTop.ascx, ft2PageTop.ascx, sbPageTop.ascx, macPageTop.ascx etc. I would have the same files for the NavigateTop.ascx and PageBottom.asc. The ones that...
8
3186
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 I'm having is that the partial class signature in my projectDetails.ascx.cs file looks like this: public partial class ProjectDetailsControl<TEntryServiceProvider: UserControl, INamingContainer where TEntryServiceProvider : IEntryServiceProvider...
9
3191
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 load with different data (locations, departments, etc.).
9
2599
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 simultaneously work on development. Does splitting the database and creating FE's work for this scenario? And if so, would the changes that both users make be saved into the original .mdb? Is there any good source that I can read more about this in detail...
1
1088
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 created, it creates a connection to the database. My initial plan was that, at the very top of each page I would: 1) include the DBClass class file, so the page knows about the class 2) create an instance of DBClass, which I call DB. My thought...
1
1878
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 for each user control. One view is the “readonly” view and the other is the “Edit” view The key is that I only want one user control to be in EDIT mode at a given time. If the user tries to change the ActiveViewIndex of control A to be in...
0
8944
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, well explore What is ONU, What Is Router, ONU & Routers main usage, and What is the difference between ONU and Router. Lets take a closer look ! Part I. Meaning of...
0
8773
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
9234
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9180
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6733
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupr who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4805
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3259
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2721
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2177
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.