silverlight

StringFormat in wp7?

删除回忆录丶 提交于 2019-12-19 20:37:00
问题 Is there a way to combine static text AND binding in one TextBlock? Because StringFormat don't work in windows phone 7. I try <TextBlock Text="{Binding strAudioArtistName, StringFormat=StaticText: {0}}"/> but don't work.... Thank 回答1: Actually if you can change your viewmodel and do the formatting in a property you will get much better performance than relying on an IValueConverter. I use a pattern along these lines to still give me property change notifications string _value; public string

Use a rectangle shape as a clip in XAML

痴心易碎 提交于 2019-12-19 19:49:20
问题 Is there a way that I can use a normal Rectangle (shape) as part of a clip for another object in XAML. It seems like I should be able to, but the solution is eluding me.. <Canvas> <Rectangle Name="ClipRect" RadiusY="10" RadiusX="10" Stroke="Black" StrokeThickness="0" Width="32.4" Height="164"/> <!-- This is the part that I cant quite figure out.... --> <Rectangle Width="100" Height="100" Clip={Binding ElementName=ClipRect, Path="??"/> </Canvas> I know that I can use a 'RectangleGeometry' type

System.Linq.GroupBy Key not binding in silverlight

余生颓废 提交于 2019-12-19 19:45:15
问题 list.ItemsSource=db.Templates.GroupBy(t=>t.CategoryName); in xaml: <DataTemplate> <TextBlock Text="{Binding Key}" /> </DataTemplate> After this code. Don't show any text in TextBlock. I'm changing Text binding like this <DataTemplate> <TextBlock Text="{Binding}" /> </DataTemplate> TextBlock Text shown like this System.Linq.Lookup^2+Grouping[System.String,Model.Template] I'm debugging and checking Key property. this is not null. Why Key don't bind in TextBlock? How to show group title in

How can I put a Silverlight 3 DataGridCell into edit mode in code?

妖精的绣舞 提交于 2019-12-19 18:53:33
问题 I want to be able to pick a specific cell in a Silverlight 3.0 DataGrid and put it into edit mode. I can use the VisualTreeManager to locate the cell. How do I switch to edit mode? Each DataGridCell looks like this in the VisualTreeManager: System.Windows.Controls.DataGridCell System.Windows.Controls.Grid System.Windows.Shapes.Rectangle System.Windows.Controls.ContentPresenter System.Windows.Controls.TextBlock System.Windows.Shapes.Rectangle System.Windows.Shapes.Rectangle with the TextBlock

DisplayAttribute name property not working in Silverlight

旧时模样 提交于 2019-12-19 17:54:07
问题 I am binding DataGrid.ItemsSource property to the List<PersonDetails> object. I am getting datas through Silverlight-enabled WCF Service . So the PersonDetails class is implemented in Web Project. Each DataGrid's header text is changing as i want if the class is located in Silverlight project. But then I can not use this class in the web service. The only solution is to add same class in to the both of the projects. But, is there any other way? The class looks like that: [DataContract] public

DisplayAttribute name property not working in Silverlight

☆樱花仙子☆ 提交于 2019-12-19 17:54:05
问题 I am binding DataGrid.ItemsSource property to the List<PersonDetails> object. I am getting datas through Silverlight-enabled WCF Service . So the PersonDetails class is implemented in Web Project. Each DataGrid's header text is changing as i want if the class is located in Silverlight project. But then I can not use this class in the web service. The only solution is to add same class in to the both of the projects. But, is there any other way? The class looks like that: [DataContract] public

Databind Resource File in XAML

做~自己de王妃 提交于 2019-12-19 17:30:21
问题 For localization I'm using the Resource-file (.resx files) functionality in .NET, but I'm wondering if there's a smart way to databind the various localization properties directly in XAML? The resource file only seems to expose static properties, which I can't figure out how to bind from a viewmodel, or other resource dictionary. Also, if it's possible, I'd like it to work at design-time with Expression Blend. 回答1: Here is how I do it. WPF: Create a resource file and in the same assembly

Check For Third-Party App Installation

走远了吗. 提交于 2019-12-19 12:51:28
问题 In my app B , I need to check if app A ever installed. If A has been installed, B will invoke A . If A has not been installed, B will go to marketplace to download A . how to implement this??? ANY ADVICE WILL BE GREAT! THANKS! 回答1: There is currently no way for you to check whether a third-party application was installed on the device. However, it you are the publisher of that application, you can use: IEnumerable<Package> apps = Windows.Phone.Management.Deployment.InstallationManager

Get All node name in xml in silverlight

牧云@^-^@ 提交于 2019-12-19 12:21:32
问题 i created one xml like this <names> <name> nixon </name> </names> i want iterate each node name by foreach loop or any other loop in silverlight using xdocument. how can i get this node name? 回答1: You can use the DescendantsAndSelf() method of XElement to get all the nodes and their names. foreach (XElement child in doc.Root.DescendantsAndSelf()) { Console.WriteLine(child.Name.LocalName); } DescendantsAndSelf() Returns a collection of elements that contain this element, and all descendant

Passing parameters from silverlight to ASP.net

泄露秘密 提交于 2019-12-19 11:55:33
问题 I've made a little game in silverlight that records users scores whilst they play. I decided it would be a lot better if I could implement a leaderboard, so I created a database in mySQL to store all the high scores along with names and dates. I have created some communications to the database in ASP.net. This works and I can simply insert and get data within the code. It's now time to link the silverlight project with the ASP.net database communications, so I can send the users name and