silverlight

windows phone 7 silverlight user control: data binding not working on custom property

余生长醉 提交于 2019-12-22 12:27:10
问题 I have a rather simple user control (RatingControl) that has a dependency property defined as follows: public partial class RatingControl : UserControl { public RatingControl() { InitializeComponent(); } public static readonly DependencyProperty RatingValueProperty = DependencyProperty.Register("RatingValue", typeof(double), typeof(RatingControl), new PropertyMetadata(0.0)); public double RatingValue { set { double normalizeValue = 0.0; if (value > 10.0) { normalizeValue = 10.0; } else if

Changing the width of a vertical scrollbar

只谈情不闲聊 提交于 2019-12-22 12:25:11
问题 in my Silverlight 4 application, I have a ScrollViewer. I want to change the width of the vertical Scrollbar of the Scrollviewer, to make it a bit thinner. I have searched for a simple solution, but I do not need/want to restyle the whole Scrollbar. I was thinking about something like: MyScrollViewer.VerticalScrollbar.Width = 8; But there is no such Property. Any idea, how to make the scroll bar thinner? Thanks in advance, Frank 回答1: There is no direct way of getting the vertical scrollbar of

Do i *have* to use ObservableCollection in Silverlight WCF client?

こ雲淡風輕ζ 提交于 2019-12-22 12:18:37
问题 When accessing Silverlight in WCF you get proxies generated with ObservableCollection Thats fine when you're databinding, but a little clumsy when you're just calling a method. For instance the following service method : [OperationContract] public SearchOrdersMsgOut SearchOrders(ShippingStatusType[] shippingStatuses, string[] orderId) { } gets generated with ObservableCollection . What! They're just parameters. Why would I ever want to 'observe' them? I'm fine if I have to do this - but it

ArcGIS API for Silverlight 之ElementLayer使用及TextSymbol的模板使用

南楼画角 提交于 2019-12-22 11:37:46
原文: ArcGIS API for Silverlight 之ElementLayer使用及TextSymbol的模板使用 在开发中动态在地图上添加文字信息,可以使用TextSymbol添加文字 //动态添加文本 TextSymbol textSymbol = new TextSymbol() { FontFamily = new System.Windows.Media.FontFamily("Microsoft YaHei"), Foreground = new System.Windows.Media.SolidColorBrush(Color.FromArgb(255, 255, 0, 0)), FontSize = 14, Text = item.ZDMC, OffsetX = 12, OffsetY = -5 }; Graphic graphicText1 = new Graphic() { Geometry = mercator.FromGeographic(new MapPoint(double.Parse(item.Latitute.ToString().Trim(), System.Globalization.CultureInfo.InvariantCulture), double.Parse(item.Longitute.ToString().Trim()

Target Silverlight Version is stuck

…衆ロ難τιáo~ 提交于 2019-12-22 11:36:06
问题 I have my shiny new Visual Studio 2010. I want to develop a Silverlight 4 web app with it. I made a project and it told me that I needed to update my Developer version of Silverlight. I followed the link provided and did what it suggested. I then went back and created my project (under a different directory). But when I try to select the target version of Silverlight all I can see is Silverlight 3. What do I need to do to get this to show the Silverlight 4 option? 回答1: Make sure you've

How to create binding inside custom control automatically?

时光毁灭记忆、已成空白 提交于 2019-12-22 11:27:30
问题 I have my custom toolbar control with DependencyProperty IsBusy Here is how I use it: <Controls:myToolbar Grid.ColumnSpan="5" Mode="DataEntry" Status="{Binding State, Converter={StaticResource ViewEditingStateToToolbarStateConverter}}" IsBusy="{Binding IsBusy}"/> By convention all my VM's inherit from base VM and have IsBusy property. So, I KNOW that this property will always be available on VM. Now I have another 4 properties like this. Instead of adding them to XAML on all my views I want

Why is my unit test of my Silverlight XAML bindings is failing?

主宰稳场 提交于 2019-12-22 10:58:10
问题 I've got the following combobox defined: <ComboBox x:Name="cmbCurrency" ItemsSource="{Binding IsoCurrenciesList}" DisplayMemberPath="Description" SelectedValuePath="LocaleID" SelectedValue="{Binding CurrencyId, Mode=TwoWay"> </ComboBox> Where IsoCurrenciesList is an IEnumerable<IsoCurrency> - the type being defined by us and declared in the view model as: private IEnumerable<IsoCurrency> isoCurrenciesList; public IEnumerable<IsoCurrency> IsoCurrenciesList { get { return isoCurrenciesList; }

Silverlight ChildWindow Memory Leak

余生长醉 提交于 2019-12-22 10:48:44
问题 Does anyone know how to resolve to the memory leak in SL3 with the ChildWindow? Refer to the code snippet below: private void Button_Click(object sender, RoutedEventArgs e) { var window = new ChildWindow(); window.Closed += new EventHandler(window_Closed); window.Show(); } void window_Closed(object sender, EventArgs e) { ((ChildWindow)sender).Closed -= new EventHandler(window_Closed); WeakReference reference = new WeakReference(sender); GC.Collect(); GC.WaitForPendingFinalizers(); bool

Application Pool Mode Problem: Classic Or Integrated

烂漫一生 提交于 2019-12-22 10:30:03
问题 I am facing an issue and was hoping if you could please provide me with some guidance: I have a Asp.net 4.0 website application that uses spring.net and ext.net libraries. I have deployed it in IIS 7 using classic application pool mode and it works. It doesn't work in integrated mode . I have another Asp.net 4.0 silverlight website application that is deployed in IIS 7 using integrated application mode and it works. It doesn't work in classic mode . I have created a new ASP.net web

Cleanest way to bind a Button's visibility to the contents of two textboxes

帅比萌擦擦* 提交于 2019-12-22 10:17:21
问题 I have a Button within my app whose "enabledness" I have bound to whether a TextBox is empty as so: <Button Content="Go" IsEnabled="{Binding Text, Converter={StaticResource EnableIfStringNotEmptyDataSource}, ElementName=MyTextbox}"/> (implementation of EnableIfStringNotEmptyDataSource omitted for brevity). This automatically changes the state when the TextBox 's text changes. What would be the most elegant way of binding a property in the same manner to whether two textboxes are both empty or