silverlight-4.0

how to create Multiple user control that pointing single code behind file in silverlight 4

我是研究僧i 提交于 2019-11-28 11:45:26
I am creating a application, in which i have 2 user control, is it possible that, we have 2 xaml user control page and having 1 code behind xaml.cs file? AnthonyWJones Start off by creating three files, first the "code-behind" .cs file is created as a simple class:- public class MyCommonUserControl : UserControl { } Note it has no InitializeComponent call. Now create a new UserControl then modify its xaml to look like this:- <local:MyCommonUserControl x:Class="YourApp.FirstMyCommonUserControl " xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft

Simple example of DispatcherHelper

妖精的绣舞 提交于 2019-11-28 11:25:46
I'm trying to figure out how can I use DispatcherHelperftom MVVM light toolkit in SL, but I can't find any example. From home page of this framework I know that DispatcherHelper class, a lightweight class helping you to create multithreaded applications. But I don't know how to use it. How and for what I can use it? You only need the DispatcherHelper when yo want to make changes to components on your UI thread, from code that runs on a different thread. E.g. in an Silverlight application you call a web service to retrieve some data asynchroneously, and now want to inform the Ui that the data

How to pass a value between Silverlight pages for WP7?

删除回忆录丶 提交于 2019-11-28 10:29:04
问题 I've got a MainPage.xaml page a Detail.xaml page. I've passed variables to the Detail.xaml from MainPage.xaml by using a static variable and referencing it in Detail.xaml (the detail page is acting like a dialog). However once I've updated the content of another object, I want to call a method in MainPage.xaml to refresh the content of that page using the updated object from the Detail.xaml page. I assume I am not using the correct paradigm for this and should probably be using MVVM or

Dynamic query with WCF RIA Services

天涯浪子 提交于 2019-11-28 10:20:00
问题 I use Silverlight 4 with WCF RIA Services (domain services with EF4). Now I'd like to add a functionality, which allow an user to query data based on the criteria user selected (ad-hoc query). I've found that: -WCF RIA Services doesn't allow anonymous types, so linq projection isn't possible. -Exposing OData doesn't help (much), because you can't filter data at client-side. Searching Internet, it seems I can use dynamic linq library described in the following link: http://weblogs.asp.net

Why can't I tap/click blank areas inside of a Border/ContentControl without setting the child's background to transparent?

我的未来我决定 提交于 2019-11-28 08:54:08
问题 I finally was able to create an "easy" transparent button control, based off a ContentControl . However, can someone explain why I couldn't click/tap any blank areas of the control until I set the background of the child element to transparent? I ran into this issue also when: I tried to use Border I set the ControlTemplate of a button rather than the ContentTemplate . Here's my "button" class: public class TransparentButton : ContentControl { public TransparentButton() {

How can I get a screen resolution of Device (Windows Phone)

老子叫甜甜 提交于 2019-11-28 07:10:12
问题 How can I get a screen resolution of Device from settings (Windows Phone) ? 回答1: public void GetScreenResolution() { string ScreenWidth = Application.Current.Host.Content.ActualWidth.ToString(); string ScreenHeight = Application.Current.Host.Content.ActualHeight.ToString(); MessageBox.Show(ScreenWidth + "*" + ScreenHeight); } 回答2: This may be a better way to know what screen resolution is your app running on. if(App.Current.Host.Content.ScaleFactor == 100) { // WVGA } else if (App.Current

How to transfer large amount of data using WCF?

痞子三分冷 提交于 2019-11-28 04:43:22
问题 We are currently trying to move large amounts of data to a Silverlight 3 client using WCF with PollingDuplex. I have read about the MultiplerMessagesPerPoll in Silverlight 4 and it appears to be quite a bit faster. Are there any examples out there for me to reference (using MultipleMessagesPerPoll)? Or maybe some good references on using Net.TCP? Maybe I should be taking a completely different approach? Any ideas or suggestions would be greatly appreciated. Thanks! 回答1: Streaming serialized

WpfToolkit DataGrid does not work in Windows Phone 7

我与影子孤独终老i 提交于 2019-11-28 04:39:52
问题 I am trying to use WpfToolkit DataGrid in Windows Phone 7 project (Silverligt 4) and it's not working. Here is the XAML: <UserControl x:Class="SilverlightControls.Grid" 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="d" xmlns:wtk="clr-namespace:Microsoft.Windows.Controls

Bind the text of RichTextBox from Xaml

不羁的心 提交于 2019-11-28 02:34:58
问题 How to Bind the text of RichTextArea from xaml 回答1: There is no built in way to do that. You can create Text attached property and bind to it like discussed here 回答2: They've got the easier answer here: Silverlight 4 RichTextBox Bind Data using DataContext and it works like a charm. <RichTextBox> <Paragraph> <Run Text="{Binding Path=LineFormatted}" /> </Paragraph> </RichTextBox> 回答3: Here is the solution I came up with. I created a custom RichTextViewer class and inherited from RichTextBox.

Why isn't Expression Blend 4's designer working whenever we use build configurations?

帅比萌擦擦* 提交于 2019-11-28 01:58:25
问题 I'm having an odd issue with Expression Blend 4. I've been using Blend 4 in conjunction with Visual Studio 2010 for quite a while without incident (beyond the ultra-frequent crashes). Now our graphics designer wants to start using Blend to do some touch-up work. We were able to get Blend to compile the solution on his computer. Unfortunately, when we try to open any XAML file, we get errors from the designer where resources included through the merged resource dictionary and attached