วันอังคารที่ 24 กรกฎาคม พ.ศ. 2555

Custom tool warning: Cannot import wsdl:portType

I created a WCF service library project in my solution, and have service references to this. I use the services from a class library, so I have references from my WPF application project in addition to the class library. Services are set up straight forward - only changed to get async service functions.
Everything was working fine - until I wanted to update my service references. It failed, so I eventually rolled back and retried, but it failed even then! So - updating the service references fails without doing any changes to it. Why?!
The error I get is this one:
Custom tool error: Failed to generate code for the service reference 
'MyServiceReference'.  Please check other error and warning messages for details.
 The warning gives more information:
Custom tool warning: Cannot import wsdl:portType
Detail: An exception was thrown while running a WSDL import extension: 
System.ServiceModel.Description.DataContractSerializerMessageContractImporter
Error: List of referenced types contains more than one type with data contract name 'Patient' in  
namespace 'http://schemas.datacontract.org/2004/07/MyApp.Model'. Need to exclude all but one of the 
following types. Only matching types can be valid references: 
"MyApp.Dashboard.MyServiceReference.Patient, Medski.Dashboard, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" (matching)
"MyApp.Model.Patient, MyApp.Model, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" (matching)
XPath to Error Source: //wsdl:definitions[@targetNamespace='http://tempuri.org/']/wsdl:portType[@name='ISomeService']
 There are two similar warnings too saying:
Custom tool warning: Cannot import wsdl:binding
Detail: There was an error importing a wsdl:portType that the wsdl:binding is dependent on.
XPath to wsdl:portType: //wsdl:definitions[@targetNamespace='http://tempuri.org/']/wsdl:portType[@name='ISomeService']
XPath to Error Source: //wsdl:definitions[@targetNamespace='http://tempuri.org/']/wsdl:binding[@name='WSHttpBinding_ISomeService']
 And the same for:
Custom tool warning: Cannot import wsdl:port ..

When you add a service reference, there are two ways the types that are used by the service can be handled:
 •The types are stored in a dll, and that dll is referenced from both the client and the server application.
 •The types are not in a dll referenced by the client. In that case the tool that creates the service reference, will create the types in the references.cs file.

 

วันอังคารที่ 10 กรกฎาคม พ.ศ. 2555

ShowLoadingPanel

 <devx:GridControl
Grid.Row="1" x:Name="dgTest"
ShowLoadingPanel="{Binding Path=IsLoading, Mode=TwoWay}"
ItemsSource="{Binding Path=LstData, Mode=TwoWay}"
AutoPopulateColumns="False"
HorizontalAlignment="Stretch"
VerticalAlignment="Stretch"
AllowColumnMRUFilterList="False"
IsFilterEnabled="False">

วันจันทร์ที่ 9 กรกฎาคม พ.ศ. 2555

Expand/collapse Group when click on group header

Expand/collapse Group when click on group header

When I have a grid that groups items is there a way to expand/collapse the group when the user clicks on the text in the header? Right now the only way to expand/collapse a group is to click on the expand button in the header.

To accomplish your task handle the MouseLeftButtonUp event in the following manner:

[C#]Open in popup window
private void tableView1_MouseLeftButtonUp(object sender, MouseButtonEventArgs e) {            
TableView view = sender as TableView;            
TableViewHitInfo hi = view.CalcHitInfo(e.OriginalSource as DependencyObject);            
if (hi.HitTest == TableViewHitTest.GroupValue)                
ToggleExpandedState(view);        
}        

private void ToggleExpandedState(TableView view)        
{            
if (view.Grid.IsGroupRowExpanded(view.FocusedRowHandle))                
view.CollapseFocusedRow();            
else view.ExpandFocusedRow();        
}