I have this Windows Phone Page where I load data through the standard ViewModel scope.
public Profile()
{
InitializeComponent();
App.PersonalizedViewModel.favorites.Clear();
DataContext = App.PersonalizedViewModel;
this.Loaded += new Routed...
Ah, ok - well I hope you had a lovely weekend! To be honest I've only be stuck since today but it's on the thing you helped with before, you might not remember but it was to do with setting up some binding with INotifyPropertyChanged
Haha, ok. Well basically originally you helped me get it working so that the binding happened on app initialisation and it bound to a Datatemplate within a ListView and it worked great.
what I'm trying to do now is change a couple of textblocks somewhere else in the view based on which item the user clicks and I have no idea of getting my app to understand which of the loaded buttons they clicked.
Because the textblocks should display some of the data that is stored in the Collection that is being used to populate the button Content - It thought I could reuse the same collection and Data Context somehow (if that makes sense)?
I found some ideas online but they seemed very complicated, like looping through the visual tree until finding the right one.
I get the basic principle of it I think, I'm going to try and code and see where I get. I will almost certainly have more questions but I like trying to figure it out myself first (which occasionally happens).
If you don't mind, another question I had about last time was with the code in this method.
public ObservableCollection<Term> displayLaunchTerms(string searchValue)
{
ObservableCollection<Term> result = null;
Search loadSearch = new Search();
result = loadSearch.QueryRequest(searchValue);
TermsCollection = result;
return TermsCollection;
}
Which is related to the property of the class below:
public ObservableCollection<Term> TermsCollection
{
get { return TermName; }
set {
TermName = value;
TermDescription = value;
NotifyPropertyChanged();
}
}
I was trying to make the method slightly cleaner and wanted to simply put 'TermsCollection = loadSearch....' however that doesn't work - the Collection never binds to my Controls, I need the TermsCollection = result; Why is this? It appears to me that they are the same format and value.
But if you have many settings (not just baud rate) a list of attributes can get rather long. Also, I believe the element syntax is required if the child is an object.
when a user creates a communication profile... I want to provide them with a list of profiles that have their settings already set if they pick a preconfigured profile
i also want to provide them with options for some fields like Baud Rate and Parity
those options might have to be in a different XML document though...
@ReedCopsey and some of the options are found at the bottom of the gist.
so someone creating a new profile will see: "Serial, TCP, WDS" ... they will select Serial. Then they could pick from "Profile 1, Profile 2, Profile 3, Custom" ... picking one of those will set the defaults for selectedbaudrate/parity/timeouts, etc.
and when someone picks Profile 1, the user will be able to choose a COM Port device, baud rate, parity, etc... I just make sure the correct default is set.
If a class is going to end up having a lot of properties is there a good way to manage that? If I had something like below for each property it would get quite messy I believe.
public ObservableCollection<Term> TermsCollection
{
get { return TermName; }
set {
TermName = value;
NotifyPropertyChanged();
}
}
This is probably something very simple, but when I build my app every element is selectable. So if I click it anything it gets highlighted purple and a check mark added to it. What have I mistakenly turned on?
if you really needed thousands of clients - you could always paralellize the callback calls, but even then, you're probably not going to have a problme
PerCall means that every call to the server createsa new server instance
which probably isn't what you want, since it'd keep messages from posting across separate clients (they'd be different instances), unless you manage it outside of the class
switch that code to Single, and it's basically what you want ;)
other than customizing the message
and/or choosing a better transport
(ie: you could potentially use TCP for the transport instead of DuplexHttp, which would be better, provided the connections are allowed in your environment)
it's running ok now but crash after a sec with The InstanceContext provided to the ChannelFactory contains a UserObject that does not implement the CallbackContractType.
strange seems like i implemented all the methods for the interfaces