|
Seems that ComboBox doesnt know that HealthLevelID was changed, try this:
BindingExpression binding = BindingOperations.GetBindingExpression(cboHealth, ComboBox.SelectedIndexProperty);
if (binding != null)
{
binding.UpdateTarget();
}
Also, make sure that HealthLevelID is public
modified on Thursday, February 3, 2011 6:35 AM
|
|
|
|
|
You're missing Mode=TwoWay from your binding expression (assuming it's the same in WPF as Silverlight)
C# has already designed away most of the tedium of C++.
|
|
|
|
|
Good Day All
I have a Policy file in the Root of my wwwRoot. and i have place it in the Folders of the indivisuall services, but i get a warning that says
Warning 1 Could not locate cross-domain policy at 'vuyiswa-pc': Web services might not be accessible at runtime by your Silverlight application. For more details please contact the web server administrator or press F1 after selecting this warning 0 0
and this make my app to fail with the cross domain Error
An error occurred while trying to make a request to URI 'http://localhost/BLLBusiness/BLLService.svc'. This could be due to attempting to access a service in a cross-domain way without a proper cross-domain policy in place, or a policy that is unsuitable for SOAP services. You may need to contact the owner of the service to publish a cross-domain policy file and to ensure it allows SOAP-related HTTP headers to be sent. This error may also be caused by using internal types in the web service proxy without using the InternalsVisibleToAttribute attribute. Please see the inner exception for more details.
Does any have an Idea ?
Vuyiswa Maseko,
Spoted in Daniweb-- Sorry to rant. I hate websites. They are just wierd. They don't behave like normal code.
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.com
vuyiswa@its.co.za
http://www.itsabacus.co.za/itsabacus/
|
|
|
|
|
Using a wire sniffer tool like Fiddler, check if the file is actually downloaded to the client.
If no, then I guess the location of the file is incorrect.
The funniest thing about this particular signature is that by the time you realise it doesn't say anything it's too late to stop reading it.
My latest tip/trick
|
|
|
|
|
Good Day Abhi
Thanks for your reply, it is not easy to find a problem in this situation. even Fiddler pointed out nothing. so what i did to resolve this is that i have change the application Pool to .net 4 Classic and it started to work, i could see the policy files via the local-host uri.
Thanks
Vuyiswa Maseko,
Spoted in Daniweb-- Sorry to rant. I hate websites. They are just wierd. They don't behave like normal code.
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.com
vuyiswa@its.co.za
http://www.itsabacus.co.za/itsabacus/
|
|
|
|
|
Hi All,
I want Database Connectivity in my Silverlight Web Application without using WCF service. Is is possible?
I have googled but no luck.
Thank U,
Sunil G.
|
|
|
|
|
Hi Sunil,
When you want to use Silverlight for Web Developement and at the same time want to communicate with the database then you only have the option of service, whether Web Service of WCF Service.
But why don't you want to use WCF..?
|
|
|
|
|
|
No. Its not possible in silverlight. Silverlight runs client side and it cannot make server side calls.
|
|
|
|
|
Sorry, but it is possible to have a local client side database. There are a number of projects which aim to provide this functionality via Isolated Storage. Here's[^] one such example.
|
|
|
|
|
Well i don't think its no a problem to achieve that , but its not a good way to go. I have some Silverlight Apps that Connects to the Database without using WCF , i am just using pure OOP , but these are very small apps, the way to go is RIA. You need to use WCF Services its much easier like that.
Vuyiswa Maseko,
Spoted in Daniweb-- Sorry to rant. I hate websites. They are just wierd. They don't behave like normal code.
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.com
vuyiswa@its.co.za
http://www.itsabacus.co.za/itsabacus/
|
|
|
|
|
Hi
Looking for a user control which can display HTML in a string variable (not a url, not a html document saved on a disk so WebBrowser control won't do it)
Is there one?
Thanks
dev
|
|
|
|
|
WebBrowserControl has a NavigateToString [^]method - can you not use that?
___________________________________________
.\\axxx
(That's an 'M')
|
|
|
|
|
Oh I was checking out methods and properties of WebBrowser control didn't see that.
Thanks for tip
dev
|
|
|
|
|
|
To be fair, I think this is a TDD question rather than specifically WPF - but it is the use of the messanger in MVVM in WPF that is causing the issue - hence the post here...
WPF with MVVM using the bare bones of the MvvmFoundation.
public CustomerSelectionAndSummaryViewModel(IController controller, FrameworkElement view)
: base(controller, view)
{
controller.Messenger.Register(Controller.MSG_Customer_SELECTED, new Action<CustomerListItemViewData>(ProcessSelection));
CustomerSelectionViewModel = new CustomerSelectionViewModel(controller);
CustomerSummaryViewModel = new CustomerSummaryViewModel(controller);
}
#endregion
private void ProcessSelection(CustomerListItemViewData CustomerListItemViewData)
{
CustomerSummaryViewModel.ViewData = Controller.GetCustomerSummaryViewData((int) CustomerListItemViewData.CustomerId);
Controller.CustomerSelected((int) CustomerListItemViewData.CustomerId);
}
Briefly, the Constructor is passed an IController - which is just a helper class, and a view (which we can ignore for these purposes)
The base class for our ViewModel stores the IController in a property.
YOu can see I register the message for a customer being selected - so that when a customer is selected I can action the selection. The rest of the constructor just instantiates a couple of other View Models that are children of this one- again this can be ignored.
So the Action passed to the Messenger.Register method 'points to' the ProcessSelection method.
Here I am saying, when something sends the Customer_SELECTED message, this ViewModel wants to handle it by executing the ProcessSelection method.
With me so far? Good Ho!
I've made the method private because the other developers are just plain stoopid (I'm a sole developer on this one, in fact, but ITRW...) and if it's not private they might decide to use it directly, which is NAGT (Not A Good Thing)
OK so, I hear you ask, what's the prob?
I want to be a good little dev and use some tests. I'd like to test the ProcessSelection() method somehow, to ensure that it calls the CustomerSelected() method with the selected Customer ID when passed a valid CustomerListItemViewData.
So (bear in mind I'm very new to TDD here)
The main stumbling block for me here is that the method is private - and I'd like it to remain so.
I can see this being a problem with these messages flying about (as the project expands) as the ViewModels are likely to use private methods to implement the functionality required when handling the message.
Many people seem to say that you shouldn't test private methods. Fair enough - but in this case shouldn't I be testing the functionality of the system when a Customer is selected?
I'm thinking that this particular private method is, in essence, public because it can be executed (be sending a message) from outside of its class. So, perhaps this is a more generic question.
The only alternate option I can think of right now would be to not test this method, but instead test the method by sending the message..?
OK - I've waffled enough! I'm, hoping you have the stamina to read through this and help me out - if not, well, it's been cathartic writing it anyhoo.
___________________________________________
.\\axxx
(That's an 'M')
|
|
|
|
|
You're right. You don't test the private method - you test the code that calls the private method. The easiest way, as you have identified, is to send the message and see what the effect is. Your test doesn't have to be complicated at all.
|
|
|
|
|
Thanks Pete,
This is a long, uphill struggle - but maybe there'll be an article at the end of it all!
___________________________________________
.\\axxx
(That's an 'M')
|
|
|
|
|
Cool. Looking forward to seeing it.
|
|
|
|
|
Hello,
I'm new in sorting and not sure how to write the sorting code in order to sort list view by clicking column headers.
I have list view with several columns in my WPF application.
I want to sort list view by clicking any column header.
The list view is populated with data from database using data binding in this way:
List<TestName> lstTestNames = client.GetAllTestNames().ToList();
lstvTestNames.ItemsSource = null;
lstvTestNames.ItemsSource = lstTestNames;
The columns are as usual, ID, string data, date/time date and so on.
The XAML code looks as follows:
<ListView Name="lstvTestNames" Height="360" HorizontalAlignment="Left" Margin="20,33,0,0" VerticalAlignment="Top" Width="465" SelectionChanged="lstvTestNames_SelectionChanged">
<ListView.View>
<GridView>
<GridViewColumn Width="50" DisplayMemberBinding="{Binding Path=test_name_id}">
<GridViewColumnHeader Name="Sort1" Click="GridViewColumnHeader_Click">ID</GridViewColumnHeader>
</GridViewColumn>
...
The sorting code should be in click handler:
private void GridViewColumnHeader_Click(object sender, RoutedEventArgs e)
{
GridViewColumnHeader column = sender as GridViewColumnHeader;
...
}
But, how does it look like?
One additional question. If I want to sort list view by ID column that contains IDs from database,
I suppose all those values are strings (maybe not?).
But, I need integer values. How to handle this?
Thank you in advance.
Goran
modified on Thursday, January 27, 2011 7:38 AM
|
|
|
|
|
Take a look at the sort()[^] method of the class.
I must get a clever new signature for 2011.
|
|
|
|
|
As I can see Sort method for WPF list view doesn't exist.
|
|
|
|
|
Well there seem to be lots of suggestions here[^].
I must get a clever new signature for 2011.
|
|
|
|
|
Thank you very much, but I've already checked them and nothing simple was there. So, it means, I haven't found what I'm looking for. I would be thankful if somebody can write some code here.
Thank you in advance.
|
|
|
|
|
Tesic Goran wrote: I've already checked them and nothing simple was there.
Well I've just been reading the article in the first link on that page, and it seemed pretty simple to me, even though I am not a WPF expert.
Tesic Goran wrote: I would be thankful if somebody can write some code here.
I don't think that's going to happen.
I must get a clever new signature for 2011.
|
|
|
|