silverlight

Grouped LongListSelector: headers appear, items don't

半腔热情 提交于 2019-12-23 20:22:02
问题 WinPhone 8 project in C#. I'm trying to populate a grouped list. The group headers appear, the items don't. The relevant code is: class MyPage { public class Group : IGrouping<string, string> { public string Title{get;set;} public string[] Items; public string Key { get { return Title; } } public IEnumerator<string> GetEnumerator() { return (Items as IEnumerable<string>).GetEnumerator(); } System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { return Items

How can I inject a XAML transformation into my build?

纵然是瞬间 提交于 2019-12-23 20:20:56
问题 I'd like to run a custom EXE against my XAML Resource Dictionaries. Let's say this exe that I've got is going to strip out comments, whitespace and unused resources. The original XAML files need to be untouched, but the XAML (silverlight) and BAML (wpf) that ends up in the XAPs and DLLs needs to be transformed. It needs to work on my computer and the build server. My question is: what's the simplest and most reliable way to run this exe? My first thought was to have a pre-build event. But

Error using ResourceDictionary in Silverlight

◇◆丶佛笑我妖孽 提交于 2019-12-23 20:14:16
问题 In my Silverlight app I have UserControl and I want to reference a StaticResource in a ResourceDictionary that is in a separate XAML file. My UserControl looks like this: <UserControl x:Class="ResourceDictionaryHeadache.MainPage" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable=

Free Silverlight mapping with Bing maps and OpenStreetMap?

余生颓废 提交于 2019-12-23 20:12:55
问题 I recently read this article. Which uses the Silverlight Bing maps control to display map data from OpenStreetMap. In this article he extends MapCore and develops a true OpenStreetMap control which no longer requires you to use the Bing API key. My question is simple. Does this solution constitute free Silverlight mapping for commercial projects or does the use of the Bing map control itself require licensing? Thanks in advance. 回答1: Following excerpted from the Microsoft Bing Maps Terms of

windows phone 7 TextBlock TextWrapping not honored in listbox

你离开我真会死。 提交于 2019-12-23 19:56:48
问题 I have a listbox defined as : <Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,0,12,0"> <ListBox x:Name="myListBox" Width="468" ScrollViewer.HorizontalScrollBarVisibility="Disabled"> <ListBox.ItemsPanel> <ItemsPanelTemplate> <toolkit:WrapPanel /> </ItemsPanelTemplate> </ListBox.ItemsPanel> <ListBox.Template> <ControlTemplate> <ScrollViewer Width="468"> <ItemsPresenter /> </ScrollViewer> </ControlTemplate> </ListBox.Template> </ListBox> </Grid> In the code, I create multiple textBlocks as

Change Source in MediaElement (SILVERLIGHT)

自古美人都是妖i 提交于 2019-12-23 19:41:26
问题 I would like to change song on my MediaElent from track1.mp3 to track2.mp3. And here is the code: MyMediaElement.Stop(); Uri u = new Uri("track2.mp3", UriKind.Relative); MyMediaElement.Source=u; MyMediaElement.Play(); The MediaElement change the source but just won't start. What could possibly be wrong with this code? 回答1: Try setting MyMediaElement.AutoPlay to true, as soon as the source changes it should play. You could also investigate using the MediaElement.SetSource() method which takes

how to Enumerate local fonts in silverlight 4

北城余情 提交于 2019-12-23 19:17:47
问题 I heard about silverlight 4 can use local fonts. So, is there a way fo enumerate them? I just want to have them shown into a listbox. 回答1: Use the SystemTypefaces static property of the System.Windows.Media.Fonts class. This provides a collection go Typeface objects listing the set of fonts found in the system font folder. 回答2: I struggled with the same issue. I ended up using Fonts.SystemFontFamilies on the SERVER (in the PresentationCore dll), and then sending a list of strings (from the

Convert IQueryable to Custom Class

点点圈 提交于 2019-12-23 18:54:23
问题 I have a LINQ query as below, public AddXferData DisplayXferDataToBeModified(int ID) { try { var resultSet = (from items in DataContext.Transfers where items.Transfer_ID.Equals(ID) select new AddXferData { XferID = items.Transfer_ID, LogicalName = items.Logical_Name, RoutCode = items.Route_Code, Label = items.Label, OnNetDNA = items.On_Net_DNA, OnNetDNB = items.On_Net_DNB, FailMessage = items.Failure_Message, }); return resultSet; } catch (Exception ex) { throw ex; } } But my resultSet asks

silverlight mpeg-4

余生颓废 提交于 2019-12-23 18:45:55
问题 im currently working on a project, where I need to create a web video player. At the current state, my app plays recordings provided by client as motion JPEG and H264/AVC. The thing is, he also wants MPEG-4 part 2 (Visual), which i call mp4v. According to this page, mp4v is supported, but i can't get any sample to work with Silverlight. Even if this encoding is not supported by Silverlight, can I get my app to display this recordings without converting them? Is there any way to get this to

How to copy image of a chart from Silverlight application to clipboard?

淺唱寂寞╮ 提交于 2019-12-23 18:35:41
问题 I have a Silverlight 3.0 applications with some custom graphics and some charts. I need to find the best way to transfer these graphics to a PowerPoint presentation. I've read that Silverlight 4.0 offers a Clipboard API, but there is only support for Unicode-text, not images. Is there a way to achieve this task without forcing users to manually PrtSc and than paste to other applicatons? 回答1: There's no simple way to do this in SL3. My recommendation would be to use a WriteableBitmap and save