Search Results

Search found 243 results on 10 pages for 'globalization'.

Page 5/10 | < Previous Page | 1 2 3 4 5 6 7 8 9 10  | Next Page >

  • Why do I get a DependencyProperty.UnsetValue when converting a value in a MultiBinding?

    - by eskerber
    I have an extremely simple IMultiValueConverter that simply OR's two values. In the example below, I want to invert the first value using an equally simple boolean inverter. <MultiBinding Converter="{StaticResource multiBoolToVis}"> <Binding Path="ConditionA" Converter="{StaticResource boolInverter}"/> <Binding Path="ConditionB"/> </MultiBinding> public class BoolInverterConverter : IValueConverter { #region IValueConverter Members public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) { if (value is bool) { return !((bool)value); } return null; } public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) { throw new NotImplementedException(); } #endregion } When I include the boolInverter, the first value in the MultiValueConverter becomes a "DependencyProperty.UnsetValue". There are no problems when I do not use the converter (other than not the logic I am aiming for, of course). Am I missing something? Stepping through the debugger shows that the InverseBoolConverter is properly inverting the value I pass it, but that value is then not being 'sent' to the MultiValueConverter.

    Read the article

  • Wpf binding to a function

    - by carlopenid
    I've a created a simple scrollviewer (pnlDayScroller) and want to have a separate horizontal scrollbar (associated scroller) to do the horizontal scrolling. All works with the below code accept I need to bind the visibility of the associated scroller. I can't simply bind this to the visibility property of the horizontal template part of the scroll viewer as I've set this to be always hidden. The only way I can think to do this is to bind the visibility of the associated scroller to a function such that If associatedScroller.scrollableWidth > 0 then associatedScroller.visibility = visibility.visible else associatedScroller.visibility = visibility.collapsed end if Is this possible to do and if so how do I do it? Private Sub pnlDayScroller_Loaded(ByVal sender As System.Object, ByVal e As System.Windows.RoutedEventArgs) Handles pnlDayScroller.Loaded Dim binViewport, binMax, binMin, binSChange, binLChange As Binding Dim horizontalScrollBar As Primitives.ScrollBar = CType(pnlDayScroller.Template.FindName("PART_HorizontalScrollBar", pnlDayScroller), Primitives.ScrollBar) binViewport = New Binding("ViewportSize") binViewport.Mode = BindingMode.OneWay binViewport.Source = horizontalScrollBar associatedScroller.SetBinding(Primitives.ScrollBar.ViewportSizeProperty, binViewport) binMax = New Binding("Maximum") binMax.Mode = BindingMode.OneWay binMax.Source = horizontalScrollBar associatedScroller.SetBinding(Primitives.ScrollBar.MaximumProperty, binMax) binMin = New Binding("Minimum") binMin.Mode = BindingMode.OneWay binMin.Source = horizontalScrollBar associatedScroller.SetBinding(Primitives.ScrollBar.MinimumProperty, binMin) binSChange = New Binding("SmallChange") binSChange.Mode = BindingMode.OneWay binSChange.Source = horizontalScrollBar associatedScroller.SetBinding(Primitives.ScrollBar.SmallChangeProperty, binSChange) binLChange = New Binding("LargeChange") binLChange.Mode = BindingMode.OneWay binLChange.Source = horizontalScrollBar associatedScroller.SetBinding(Primitives.ScrollBar.LargeChangeProperty, binLChange) End Sub Private Sub associatedScroller_Scroll(ByVal sender As System.Object, ByVal e As System.Windows.RoutedPropertyChangedEventArgs(Of Double)) Handles associatedScroller.ValueChanged pnlDayScroller.ScrollToHorizontalOffset(e.NewValue) end sub FOLLOW UP (thanks to JustABill) : I've add this code into the pnlDayScroller sub above (I've discovered scrollableWidth is a property of scrollviewer not scrollbar, but the maximum property gives a result I can use instead) binVisibility = New Binding("Maximum") binVisibility.Mode = BindingMode.OneWay binVisibility.Source = horizontalScrollBar binVisibility.Converter = New ScrollableConverter associatedScroller.SetBinding(Primitives.ScrollBar.VisibilityProperty, binVisibility) and I've created this class Public Class ScrollableConverter Implements IValueConverter Public Function Convert(ByVal value As Object, ByVal targetType As Type, ByVal parameter As Object, ByVal culture As System.Globalization.CultureInfo) As Object Implements IValueConverter.Convert Dim dblMaximum As Double If targetType IsNot GetType(Visibility) Then Throw New InvalidOperationException("The target must be a visibility") Else dblMaximum = CType(value, Double) Debug.WriteLine("Value of double is " & dblMaximum) If dblMaximum > 0 Then Return Visibility.Visible Else Return Visibility.Collapsed End If End If End Function Public Function ConvertBack(ByVal value As Object, ByVal targetType As Type, ByVal parameter As Object, ByVal culture As System.Globalization.CultureInfo) As Object Implements IValueConverter.ConvertBack Throw New NotSupportedException() End Function End Class And the problem is resolved.

    Read the article

  • CultureInfo on a IValueConverter implementation

    - by slugster
    When a ValueConverter is used as part of a binding, one of the parameters to the Convert function is a System.Globalization.CultureInfo object. Can anyone tell me where this culture object gets its info from? I have some code that formats a date based on that culture. When i access my silverlight control which is hosted on my machine, it formats the date correctly (using the d/MM/yyyy format, which is set as the short date format on my machine). When i access the same control hosted on a different server (from my client machine), the date is being formatted as MM/dd/yyyy hh:mm:ss - which is totally wrong. Coincidentally the regional settings on the server are set to the same as my client machine. This is the code for my value converter: public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) { if (value is DateTime) { if (parameter != null && !string.IsNullOrEmpty(parameter.ToString())) return ((DateTime)value).ToString(parameter.ToString()); else return ((DateTime)value).ToString(culture.DateTimeFormat.ShortDatePattern); } return value; } basically, a specific format can be specified as the converter parameter, but if it isn't then the short date pattern of the culture object is used.

    Read the article

  • WPF binding to ComboBox SelectedItem when reference not in ItemsSource.

    - by juharr
    I'm binding the PageMediaSize collection of a PrintQueue to the ItemSource of a ComboBox (This works fine). Then I'm binding the SelectedItem of the ComboBox to the DefaultPrintTicket.PageMediaSize of the PrintQueue. While this will set the selected value to the DefaultPrintTicket.PageMediaSize just fine it does not set the initially selected value of the ComboBox to the initial value of DefaultPrintTicket.PageMediaSize This is because the DefaultPrintTicket.PageMediaSize reference does not match any of the references in the collection. However I don't want it to compare the objects by reference, but instead by value, but PageMediaSize does not override Equals (and I have no control over it). What I'd really like to do is setup a IComparable for the ComboBox to use, but I don't see any way to do that. I've tried to use a Converter, but I would need more than the value and I couldn't figured out how to pass the collection to the ConverterProperty. Any ideas on how to handle this problem. Here's my xaml <ComboBox x:Name="PaperSizeComboBox" ItemsSource="{Binding ElementName=PrintersComboBox, Path=SelectedItem, Converter={StaticResource printQueueToPageSizesConverter}}" SelectedItem="{Binding ElementName=PrintersComboBox, Path=SelectedItem.DefaultPrintTicket.PageMediaSize}" DisplayMemberPath="PageMediaSizeName" Height="22" Margin="120,76,15,0" VerticalAlignment="Top"/> And the code for the converter that gets the PageMediaSize collection public class PrintQueueToPageSizesConverter : IValueConverter { public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) { return value == null ? null : ((PrintQueue)value).GetPrintCapabilities().PageMediaSizeCapability; } public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) { throw new NotImplementedException(); } }

    Read the article

  • silverlight master-detail with two listboxes in pure xaml with ria services throwing exception

    - by Sam
    Hi, I was trying to achieve master-detail with 2 ListBox, 2 DomainDataSource and a IValueConverter, when entering the page it throws the random error it does when your xaml is invalid: "AG_E_PARSER_BAD_PROPERTY_VALUE [Line: 24 Position: 61]" Which is in fact the start position of where I am binding the listbox selected item with converter to the parameter's value of my DomainDataSource. I would love to achieve this by pure xaml, I did it by code behind and that works but I don't like it :p When the parameter is a hard-coded integer 1, it works, so I assume it's the value binding My code is below here, thanks in advance for at least looking :) (taken into accound all the xmlns's & usings are correct) Xaml: <Grid x:Name="LayoutRoot"> <Grid.Resources> <helpers:ListItemtoIdListValueConverter x:Key="mListConverter" /> </Grid.Resources> <riacontrols:DomainDataSource x:Name="GetLists" DomainContext="{StaticResource DbContext}" LoadSize="20" QueryName="GetLists" AutoLoad="True" /> <riacontrols:DomainDataSource x:Name="GetListItems" DomainContext="{StaticResource DbContext}" LoadSize="20" QueryName="GetListItemsById" AutoLoad="True"> <riacontrols:DomainDataSource.QueryParameters> <riadata:Parameter ParameterName="id" Value="{Binding ElementName=ListBoxLists, Path=SelectedItem, Converter={StaticResource mListConverter}}" /> </riacontrols:DomainDataSource.QueryParameters> </riacontrols:DomainDataSource> <activity:Activity IsActive="{Binding IsBusy, ElementName=ListBoxListItems}"> <StackPanel Orientation="Horizontal"> <ListBox x:Name="ListBoxLists" ItemsSource="{Binding Data, ElementName=GetLists, Mode=OneWay}" Width="150" Margin="0,0,10,10" /> <ListBox x:Name="ListBoxListItems" ItemsSource="{Binding Data, ElementName=GetListItems, Mode=OneWay}" Width="150" Margin="0,0,10,10" /> </StackPanel> </activity:Activity> </Grid> IValueConverter: public class ListItemtoIdListValueConverter: IValueConverter { #region IValueConverter Members public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) { list mList = (list)value; if (mList != null) return mList.id; else return null; } public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) { throw new NotImplementedException(); } #endregion }

    Read the article

  • WPF designer gives exception when databinding a label to a checkbox

    - by John
    I'm sure it's something stupid, but I'm playing around with databinding. I have a checkbox and a label on a form. What I'm trying to do is simply bind the Content of the label to the checkbox's IsChecked value. What I've done runs fine (no compilation errors and acts as expected), but if I touch the label in the XAML, the designer trows an exception: System.NullReferenceException Object reference not set to an instance of an object. at MS.Internal.Designer.PropertyEditing.Editors.MarkupExtensionInlineEditorControl.BuildBindingString(Boolean modeSupported, PropertyEntry propertyEntry) at <Window x:Class="UnitTestHelper.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:FileSysCtls="clr-namespace:WPFFileSystemUserControls;assembly=WPFFileSystemUserControls" xmlns:HelperClasses="clr-namespace:UnitTestHelper" Title="MainWindow" Height="406" Width="531"> <Window.Resources> <HelperClasses:ThreestateToBinary x:Key="CheckConverter" /> </Window.Resources> <Grid Height="367" Width="509"> <CheckBox Content="Step into subfolders" Height="16" HorizontalAlignment="Left" Margin="17,254,0,0" Name="chkSubfolders" VerticalAlignment="Top" Width="130" IsThreeState="False" /> <Label Height="28" HorizontalAlignment="Left" Margin="376,254,0,0" Name="lblStepResult" VerticalAlignment="Top" Width="120" IsEnabled="True" Content="{Binding IsChecked, ElementName=chkSubfolders, Mode=OneWay, UpdateSourceTrigger=PropertyChanged, Converter={StaticResource CheckConverter}}" /> </Grid> The ThreeStateToBinary class is as follows: class ThreestateToBinary : IValueConverter { #region IValueConverter Members public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) { if ((bool)value) return "Checked"; else return "Not checked"; //throw new NotImplementedException(); } public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) { return ((string)value == "Checked"); //throw new NotImplementedException(); } #endregion } Quite honestly, I'm playing around with it at this point. It was originally simpler (not using the ValueConverter) but was displaying similar behavior when I simply had the content set to: Content="{Binding IsChecked, ElementName=chkSubfolders, UpdateSourceTrigger=PropertyChanged}" Any ideas? Thanks, John

    Read the article

  • Dependency Injection for Windows Phone 7

    - by Igor Zevaka
    I was trying to use Unity 2.0 beta 2 for Silverlight in my Windows Phone 7 project and I kept getting this crash: Microsoft.Practices.Unity.Silverlight.dll!Microsoft.Practices.ObjectBuilder2.DynamicMethodConstructorStrategy.DynamicMethodConstructorStrategy() + 0x1f bytes Microsoft.Practices.Unity.Silverlight.dll!Microsoft.Practices.ObjectBuilder2.DynamicMethodConstructorStrategy.DynamicMethodConstructorStrategy() + 0x1f bytes mscorlib.dll!System.Reflection.RuntimeConstructorInfo.InternalInvoke(System.Reflection.RuntimeConstructorInfo rtci = {System.Reflection.RuntimeConstructorInfo}, System.Reflection.BindingFlags invokeAttr = Default, System.Reflection.Binder binder = null, object parameters = {object[0]}, System.Globalization.CultureInfo culture = null, bool isBinderDefault = false, System.Reflection.Assembly caller = null, bool verifyAccess = true, ref System.Threading.StackCrawlMark stackMark = LookForMyCaller) mscorlib.dll!System.Reflection.RuntimeConstructorInfo.InternalInvoke(object obj = null, System.Reflection.BindingFlags invokeAttr = Default, System.Reflection.Binder binder = null, object[] parameters = {object[0]}, System.Globalization.CultureInfo culture = null, ref System.Threading.StackCrawlMark stackMark = LookForMyCaller) + 0x103 bytes mscorlib.dll!System.Activator.InternalCreateInstance(System.Type type = {Name = "DynamicMethodConstructorStrategy" FullName = "Microsoft.Practices.ObjectBuilder2.DynamicMethodConstructorStrategy"}, bool nonPublic = false, ref System.Threading.StackCrawlMark stackMark = LookForMyCaller) + 0xf0 bytes mscorlib.dll!System.Activator.CreateInstance() + 0xc bytes Microsoft.Practices.Unity.Silverlight.dll!Microsoft.Practices.ObjectBuilder2.StagedStrategyChain.AddNew(Microsoft.Practices.Unity.ObjectBuilder.UnityBuildStage stage = Creation) + 0x1d bytes Microsoft.Practices.Unity.Silverlight.dll!Microsoft.Practices.Unity.UnityDefaultStrategiesExtension.Initialize() + 0x6c bytes Microsoft.Practices.Unity.Silverlight.dll!Microsoft.Practices.Unity.UnityContainerExtension.InitializeExtension(Microsoft.Practices.Unity.ExtensionContext context = {Microsoft.Practices.Unity.UnityContainer.ExtensionContextImpl}) + 0x31 bytes Microsoft.Practices.Unity.Silverlight.dll!Microsoft.Practices.Unity.UnityContainer.AddExtension(Microsoft.Practices.Unity.UnityContainerExtension extension = {Microsoft.Practices.Unity.UnityDefaultStrategiesExtension}) + 0x1a bytes Microsoft.Practices.Unity.Silverlight.dll!Microsoft.Practices.Unity.UnityContainer.UnityContainer() + 0xf bytes Thinking I could resolve it I've tried a few things but to no avail. Turns out that this is a rather fundamental problem and my assumption that Windows Phone 7 is Silverlight 3 + Some other stuff is wrong. This page describes the differences between Mobile Silverlight and Silverlight 3. Of particular interest is this: The System.Reflection.Emit namespace is not supported in Silverlight for Windows Phone. This is precisely why Unity is crashing on the phone, DynamicMethodConstructorStrategy class uses System.Reflection.Emit quite extensively... So the question is, what alternative to Unity is there for Windows Phone 7?

    Read the article

  • Change made in the Converter will notify the change in the bound property?

    - by Kishore Kumar
    I have two property FirstName and LastName and bound to a textblock using Multibinidng and converter to display the FullName as FirstName + Last Name. FirstName="Kishore" LastName="Kumar" In the Converter I changed the LastName as "Changed Text" values[1] = "Changed Text"; After executing the Converter my TextBlock will show "Kishore Changed Text" but Dependency property LastName is still have the last value "Kumar". Why I am not getting the "Changed Text" value in the LastName property after the execution?. Will the change made at converter will notify the bound property? <Window.Resources> <local:NameConverter x:Key="NameConverter"></local:NameConverter> </Window.Resources> <Grid> <TextBlock> <TextBlock.Text> <MultiBinding Converter="{StaticResource NameConverter}"> <Binding Path="FirstName"></Binding> <Binding Path="LastName"></Binding> </MultiBinding> </TextBlock.Text> </TextBlock> </Grid> Converter: public class NameConverter:IMultiValueConverter { #region IMultiValueConverter Members public object Convert(object[] values, Type targetType, object parameter, System.Globalization.CultureInfo culture) { values[1] = "Changed Text"; return values[0].ToString() + " " + values[1].ToString(); } public object[] ConvertBack(object value, Type[] targetTypes, object parameter, System.Globalization.CultureInfo culture) { throw new NotImplementedException(); } #endregion }

    Read the article

  • Show WPF tooltip on disabled item only

    - by DT
    Just wondering if it is possible to show a WPF on a disabled item ONLY (and not when the item is enabled). I would like to give the user a tooltip explaining why an item is currently disabled. I have an IValueConverter to invert the boolean IsEnabled property binding. But it doesn't seem to work in this situation. The tooltip is show both when the item is enabled and disabled. So is is possible to bind a tooltip.IsEnabled property exclusively to an item's own !IsEnabled? Pretty straightforward question I guess, but code example here anyway: public class BoolToOppositeBoolConverter : IValueConverter { #region IValueConverter Members public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) { if (targetType != typeof(bool)) throw new InvalidOperationException("The target must be a boolean"); return !(bool)value; } public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) { if (targetType != typeof(bool)) throw new InvalidOperationException("The target must be a boolean"); return !(bool)value; } #endregion } And the binding: <TabItem Header="Tab 2" Name="tabItem2" ToolTip="Not enabled in this situation." ToolTipService.ShowOnDisabled="True" ToolTipService.IsEnabled="{Binding Path=IsEnabled, ElementName=tabItem2, Converter={StaticResource oppositeConverter}}"> <Label Content="Item content goes here" /> </TabItem> Thanks folks.

    Read the article

  • Binding ListBox ItemCount to IvalueConverter

    - by Ben
    Hi All, I am fairly new to WPF so forgive me if I am missing something obvious. I'm having a problem where I have a collection of AggregatedLabels and I am trying to bind the ItemCount of each AggregatedLabel to the FontSize in my DataTemplate so that if the ItemCount of an AggregatedLabel is large then a larger fontSize will be displayed in my listBox etc. The part that I am struggling with is the binding to the ValueConverter. Can anyone assist? Many thanks! XAML Snippet <DataTemplate x:Key="TagsTemplate"> <WrapPanel> <TextBlock Text="{Binding Name, Mode=Default}" TextWrapping="Wrap" FontSize="{Binding ItemCount, Converter={StaticResource CountToFontSizeConverter}, Mode=Default}" Foreground="#FF0D0AF7"/> </WrapPanel> </DataTemplate> <ListBox x:Name="tagsList" ItemsSource="{Binding AggregatedLabels, Mode=Default}" ItemTemplate="{StaticResource TagsTemplate}" Style="{StaticResource tagsStyle}" Margin="200,10,16.171,11.88" /> AggregatedLabel Collection using (DB2DataReader dr = command.ExecuteReader()) { while (dr.Read()) { AggregatedLabelModel aggLabel = new AggregatedLabelModel(); aggLabel.ID = Convert.ToInt32(dr["LABEL_ID"]); aggLabel.Name = dr["LABEL_NAME"].ToString(); LabelData.Add(aggLabel); } } Converter public class CountToFontSizeConverter : IValueConverter { #region IValueConverter Members public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) { const int minFontSize = 6; const int maxFontSize = 38; const int increment = 3; int count = (int)value; if ((minFontSize + count + increment) < maxFontSize) { return minFontSize + count + increment; } return maxFontSize; } public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) { throw new NotImplementedException(); } #endregion } AggregatedLabel Class public class AggregatedLabelModel { public int ID { get; set; } public string Name { get; set; } } CollectionView ListCollectionView labelsView = new ListCollectionView(LabelData); labelsView.GroupDescriptions.Add(new PropertyGroupDescription("Name"));

    Read the article

  • Culture Sensitive GetHashCode

    - by user114928
    Hi, I'm writing a c# application that will process some text and provide basic query functions. In order to ensure the best possible support for other languages, I am allowing the users of the application to specify the System.Globalization.CultureInfo (via the "en-GB" style code) and also the full range of collation options using the System.Globalization.CompareOptions flags enum. For regular string comparison I'm then using a combination of: a) String.Compare overload that accepts the culture and options b) For some bulk processes I'm caching the byte data (KeyData) from CompareInfo.GetSortKey (overload that accepts the options) and using a byte-by-byte comparison of the KeyData. This seemed fine (although please comment if you think these two methods shouldn't be mixed), but then I had reason to use the HashSet< class which only has an overload for IEqualityComparer<. MS documentation seems to suggest that I should use StringComparer (which implements both IEqualityComparer< and IComparer<), but this only seems to support the "IgnoreCase" option from CompareOptions and not "IgnoreKanaType", "IgnoreSymbols", "IgnoreWidth" etc. I'm assuming that a StringComparer that ignores these other options could produce different hashcodes for two strings that might be considered the same using my other comparison options. I'd therefore get incorrect results from my application. Only thought at the moment is to create my own IEqualityComparer< that generates a hashcode from the SortKey.KeyData and compares eqality be using the String.Compare overload. Any suggestions?

    Read the article

  • lighten background color on button click per binding

    - by one of two
    I want to lighten a buttons background on click. So I did the following: <converter:ColorLightConverter x:Key="colorLightConverter" /> ... <Style BasedOn="{StaticResource default}" TargetType="{x:Type controls:Button}"> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="{x:Type controls:Button}"> <ControlTemplate.Triggers> <Trigger Property="IsPressed" Value="True"> <Setter Property="Background"> <Setter.Value> <SolidColorBrush Color="{Binding Path=Background.Color, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource colorLightConverter}}" /> </Setter.Value> </Setter> </Trigger> </ControlTemplate.Triggers> <Border Background="{TemplateBinding Background}" BorderBrush="Transparent" BorderThickness="0"> ... </Border> </ControlTemplate> </Setter.Value> </Setter> </Style> The converter: class ColorLightConverter : IValueConverter { public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) { Color color = (Color)value; System.Drawing.Color lightColor = ControlPaint.Light(System.Drawing.Color.FromArgb(color.A, color.R, color.G, color.B)); return Color.FromArgb(lightColor.A, lightColor.R, lightColor.G, lightColor.B); } public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) { throw new NotImplementedException(); } } But the converter isn't called when I click the button. I think there is anything wrong with the binding, but I can't see the error... Can you help me? Maybe I'm completely wrong. What I basically want to do: When clicking the button, take the current background color and lighten it. Not more...

    Read the article

  • Parser Error Problem

    - by user177140
    Hi I have found a problem in Multilingual Asp.Net Web Application I have Created a Global.asax file and write the code private void Application_BeginRequest(Object source, EventArgs e) { string[] languages = HttpContext.Current.Request.UserLanguages; if (languages[0].ToLower() != null && languages[0].ToLower()!="") { System.Threading.Thread.CurrentThread.CurrentUICulture = new System.Globalization.CultureInfo(languages[0].ToLower()); System.Threading.Thread.CurrentThread.CurrentCulture = System.Globalization.CultureInfo.CreateSpecificCulture(languages[0].ToLower()); } } and define Label Like this <asp:Label ID="Labeldg" runat="server" Text="<%$ Resources:Resource, Labeldg %>"</asp:Label> But it through Parser error like: Parser Error Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately. Parser Error Message: The resource object with key 'LblUsrName_Login' was not found. Source Error: </div> <div class="impcLoginText_Login"> <asp:Label ID="LblUsrName" runat="server" Text="<%$ Resources:PageResource, LblUsrName_Login %>" "></asp:Label>

    Read the article

  • Globalizing ASP.NET MVC Client Validation

    One of my favorite features of ASP.NET MVC 2 is the support for client validation. Ive covered a bit about validation in the following two posts: ASP.NET MVC 2 Custom Validation covers writing a custom client validator. Localizing ASP.NET MVC Validation covers localizing error messages. However, one topic I havent covered is how validation works with globalization. A common example of this is when validating a number, the client validation should understand that users in the US enter periods...Did you know that DotNetSlackers also publishes .net articles written by top known .net Authors? We already have over 80 articles in several categories including Silverlight. Take a look: here.

    Read the article

  • Reaching the Pinnacle of Customer Experience : Customer Concepts WebTV #2

    - by Richard Lefebvre
    The challenge has never been greater – globalization increases consumer choice and quickly converts products into mere commodities. Leading companies understand that delivering exceptional customer experiences and building brand equity are vital for success. Please join us for an exclusive Web TV broadcast to hear how companies are enriching interactions differently with their customers to drive measurable business value. Our panel of experts including customers, industry thought leaders and Oracle executives will discuss how to refine the customer experience and build a digital experience to win new clients and maximise customer retention. Register now for this pan-European interactive Web TV show on Friday, July 6 at 10 a.m. BST / 11 a.m. CET. Watch and share the teaser video  REPLAY Fusion CRM Sales - Performance Management on demand: Watch and share the teaser video and replay.

    Read the article

  • The Information Driven Value Chain - Part 1

    - by Paul Homchick
    One hundred years ago, there were places on Earth that no man had ever seen.  Today, a man standing in one of those places can instantaneously communicate with someone who may be strolling down the street on his way to lunch half way around the globe.  Our world is shrinking and becoming virtual. It is a world of incredible bounty and speed where we can get a product delivered to us anywhere on earth within a day or two. However, this world is also one of challenge where volatility, uncertainty, risk and chaos are our daily companions. To prosper amid the realities of this new world, the enterprise needs a business model. Globalization and instant communications demand greater operational flexibility than ever before. Extended supply chains have elevated the management of risk to a central concern, and regulatory demands from multiple governments place an increasing burden of compliance on companies. Finally, the speed of today's business requires continuous innovation to keep from falling behind the global competition.

    Read the article

  • Consumer Electronics Show (CES) Summit:Best Practices in Transforming Channels and Partnerships

    - by charles.knapp
    Expanding consumer demand is driving the entire high technology industry, accompanied by product lifecycles as short as a few months, continued pricing and promotion pressures, and increased globalization. Unifying global channel management, operations, and execution flow will increase efficiency and growth. IT can help, but one must think beyond generic ERP and CRM. Please join Oracle and IBM at the Bellagio Hotel in Las Vegas, Wednesday January 5, 1-7 pm. Learn from IBM, VTech, Plantronics, Cisco, Symantec and Oracle High Tech Product Strategy how to improve:Channel sales, marketing, and operations management - enhance NPI, sales, forecasts, training, promotion planning, execution and settlement Winning the deal - determining the right price for the right deal for the "perfect quote", capturing the order and order management Collaborative and rapid supply chain planning - improve agility, inventory turns, and profits Register now for this FREE event. We hope you'll join us for our Oracle High Technology CES Summit and networking reception with your peers.

    Read the article

  • jQuery Templates, Data Link

    - by Renso
    Normal 0 false false false EN-US X-NONE X-NONE /* Style Definitions */ table.MsoNormalTable {mso-style-name:"Table Normal"; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-priority:99; mso-style-parent:""; mso-padding-alt:0in 5.4pt 0in 5.4pt; mso-para-margin-top:0in; mso-para-margin-right:0in; mso-para-margin-bottom:10.0pt; mso-para-margin-left:0in; line-height:115%; mso-pagination:widow-orphan; font-size:11.0pt; font-family:"Calibri","sans-serif"; mso-ascii-font-family:Calibri; mso-ascii-theme-font:minor-latin; mso-hansi-font-family:Calibri; mso-hansi-theme-font:minor-latin; mso-bidi-font-family:"Times New Roman"; mso-bidi-theme-font:minor-bidi;} Query Templates, Data Link, and Globalization I am sure you must have read Scott Guthrie’s blog post about jQuery support and officially supporting jQuery's templating, data linking and globalization, if not here it is: jQuery Templating Since we are an open source shop and use jQuery and jQuery plugins extensively to say the least, decided to look into the templating a bit and see what data linking is all about. For those not familiar with those terms here is the summary, plenty of material out there on what it is, but here is what in my experience it means: jQuery Templating: A templating engine that allows you to specify a client-side template where you indicate which properties/tags you want dynamically updated. You in a sense specify which parts of the html is dynamic and since it is pluggable you are able to use tools data jQuery data linking and others to let it sync up your template with data. What makes it more powerful is that you can easily work with rows of data, adding and removing rows. Once the template has been generated, which you do dynamically on a client-side event, you then append/inject the resulting template somewhere in your DOM, like for example you would get a JSON object from the database, map it to your template, it populates the template with your data in the indicated places, and then let’s say for example append it to a row in a table. I have not found it that useful for lets say a single record of data since you could easily just get a partial view from the server via an html type ajax call. It really shines when you dynamically add/remove rows from a list in the DOM. I have not found an alternative that meets the functionality of the jQuery template and helps of course that Microsoft officially supports it. In future versions of the jQuery plug-in it may even ship as part of the standard jQuery library and with future versions of Visual Studio. jQuery Data Linking: In short I was fascinated by it initially by how with one line of code I can sync up my JSON object with my form elements. That's where my enthusiasm stopped. It was one-line to let is deal with syncing up your form with your JSON object, but it is not bidirectional as they state and I tried all the work arounds they suggested and none of them work. The problem is that when you update your JSON object it DOES NOT sync it up with your form. In an example, accounts are being edited client side by selecting the account from a list by clicking on the row, it then fetches the entire account JSON object via ajax json-type call and then refreshes the form with the account’s details from the new JSON object. What is the use of syncing up my JSON with the form if I still have to programmatically sync up my new JSON object with each DOM property?! So you may ask: “what is the alternative”? Good question and the same one I was pondering, maybe I can just use it for keeping my from n sync with my JSON object so I can post that JSON object back to the server and update my database. That’s when I discovered Knockout: Knockout It addresses the issues mentioned above and also supports event handling through the observer pattern. Not wanting to go into detail here, Steve Sanderson, the creator of Knockout, has already done a terrific job of that, thanks Steve for a great plug-in! Best of all it integrates perfectly with the jQuery Templating engine as well. I have not found an alternative to this plugin that supports the depth and width of functionality and would recommend it to anyone. The only drawback is the embedded html attributes (data-bind=””) tags that you have to add to the HTML, in my opinion tying your behavior to your HTML, where I like to separate behavior from HTML as well as CSS, so the HTML is purely to define content, not styling or behavior. But there are plusses to this as well and also a nifty work around to this that I will just shortly mention here with an example. Instead of data binding an html tag with knockout event handling like so:  <%=Html.TextBox("PrepayDiscount", String.Empty, new { @class = "number" })%>   Do: <%=Html.DataBoundTextBox("PrepayDiscount", String.Empty, new { @class = "number" })%>   The html extension above then takes care of the internals and you could then swap Knockout for something else if you want to inside the extension and keep the HTML plugin agnostic. Here is what the extension looks like, you can easily build a whole library to support all kinds of data binding options from this:      public static class HtmlExtensions       {         public static MvcHtmlString DataBoundTextBox(this HtmlHelper helper, string name, object value, object htmlAttributes)         {             var dic = new RouteValueDictionary(htmlAttributes);             dic.Add("data-bind", String.Format("value: {0}", name));             return helper.TextBox(name, value, dic);         }       }   Hope this helps in making a decision when and where to consider jQuery templating, data linking and Knockout.

    Read the article

  • Enterprise Trade Compliance: Changing Trade Operations around the World

    - by John Murphy
    We live in a world of incredible bounty and speed where any product can be delivered anywhere on earth. However, our world is also filled with challenges for business – where volatility, uncertainty, risk, and chaos are our daily companions. To prosper amid the realities of this new world, organizations cannot rely on old strategies; they need new business models. Key trends within the global economy are mandating that companies fully integrate global trade management best practices within broader supply chain management strategies, rather than simply leaving it as a discrete event at the end of the order or procurement cycle. To explain, many companies face a complicated and changing compliance environment. This is directly linked to the speed and configuration of the supply chain, particularly with the explosion of new markets, shorter service cycles and ship times, accelerating rates of globalization and outsourcing, and increasing product complexity and regulation. Read More...

    Read the article

  • Hidden Windows 7 Wallpaper

    - by BizTalk Visionary
    To find the hidden wallpaper: Type globalization in a search of your C: drive. The only result should be a folder located in the main Windows directory, and you should only be able to see ELS and Sorting folders nested here. Now search for MCT in the top-right search bar. This will display five new unindexed folders, each corresponding to a different global region. Browse these folders for some extra themes and wallpapers specific to Australia, USA, South Africa, and Canada. From here you can select a new wallpaper.

    Read the article

  • How can I make a WPF TreeView data binding lazy and asynchronous?

    - by pauldoo
    I am learning how to use data binding in WPF for a TreeView. I am procedurally creating the Binding object, setting Source, Path, and Converter properties to point to my own classes. I can even go as far as setting IsAsync and I can see the GUI update asynchronously when I explore the tree. So far so good! My problem is that WPF eagerly evaluates parts of the tree prior to them being expanded in the GUI. If left long enough this would result in the entire tree being evaluated (well actually in this example my tree is infinite, but you get the idea). I would like the tree only be evaluated on demand as the user expands the nodes. Is this possible using the existing asynchronous data binding stuff in the WPF? As an aside I have not figured out how ObjectDataProvider relates to this task. My XAML code contains only a single TreeView object, and my C# code is: public partial class Window1 : Window { public Window1() { InitializeComponent(); treeView.Items.Add( CreateItem(2) ); } static TreeViewItem CreateItem(int number) { TreeViewItem item = new TreeViewItem(); item.Header = number; Binding b = new Binding(); b.Converter = new MyConverter(); b.Source = new MyDataProvider(number); b.Path = new PropertyPath("Value"); b.IsAsync = true; item.SetBinding(TreeView.ItemsSourceProperty, b); return item; } class MyDataProvider { readonly int m_value; public MyDataProvider(int value) { m_value = value; } public int[] Value { get { // Sleep to mimick a costly operation that should not hang the UI System.Threading.Thread.Sleep(2000); System.Diagnostics.Debug.Write(string.Format("Evaluated for {0}\n", m_value)); return new int[] { m_value * 2, m_value + 1, }; } } } class MyConverter : IValueConverter { public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) { // Convert the double to an int. int[] values = (int[])value; IList<TreeViewItem> result = new List<TreeViewItem>(); foreach (int i in values) { result.Add(CreateItem(i)); } return result; } public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) { throw new InvalidOperationException("Not implemented."); } } } Note: I have previously managed to do lazy evaluation of the tree nodes by adding WPF event handlers and directly adding items when the event handlers are triggered. I'm trying to move away from that and use data binding instead (which I understand is more in spirit with "the WPF way").

    Read the article

  • What is wrong with ToLowerInvariant()?

    - by JL
    I have the following line of code: var connectionString = configItems.Find(item => item.Name.ToLowerInvariant() == "connectionstring"); VS 2010 Code analysis is telling me the following: Warning 7 CA1308 : Microsoft.Globalization : In method ... replace the call to 'string.ToLowerInvariant()' with String.ToUpperInvariant(). Does this mean ToUpperInvariant() is more reliable?

    Read the article

  • C# locale-aware MaskedTextBox mask for DateTime values

    - by Timothy
    C# locale-aware MaskedTextBox mask for DateTime values I'm working through FXCop/Code Analysis's Globalization warnings and would like to know the proper, locale-aware way to set and get DateTime values through a MaskedTextBox. My form has a MaskedTextBox element with its Culture property set to "en-US", and its Mask property set to "00/00/0000" (the predefined Short date format). maskedTextBox.Text = now.ToString() displays without leading-zeros as "42/42/010_", yet I would like it to be represented as "04/24/2010".

    Read the article

  • .NET Weird character encoding issue

    - by born to hula
    Our globalization mechanism stores error messages in a SQL 2005 DB. Some of the error messages are used as subjects on email messages sent to the development team. Recently, with no clear reason, we started receiving emails with strangely encoded subjects, such as: =?utf-8?B?Qm1mQm92ZXNwYS5Qb3NUcmFkaW5nRXNwZWNpZmljYWNhbyAtIFN1Y2Vzc28gbm8gcmVwcm 9jZXNzYW1lbnRvLiBEYXRhIFByZWfDo28gPSAzMS8wMy8yMDEwIDAwOjAwOjAwIC0gTsO6bWVyby BkbyBFdmVudG8gZGUgTmVnw7NjaW8gPSAxMDAyIC0gQ8OzZGlnbyBOYXR1cmV6YSBkYSBPcGVyY cOnw6NvID0gQyAtIFNlcn... We don't have any clue on the reason this is happening, nor which encoding pattern is being used here (maybe utf-8?). I'd really appreciate some help.

    Read the article

  • error loading (TypeLoadException) on asp.net/xsp/mono on debian/opensuse

    - by acidzombie24
    When i reset apache and load my website i get the first error below. I have no idea what the problem is. If i reload the page again (without restarting apache) i get the 2nd error, probably because the first error occurred and BaseUser is the first class/func that Application_Start uses. Why am i getting this load exception? Whats messed up is i tried using mono's VMWare img to debug it and i got the very same exception (until i restarted which now refuses to give me anything but 404 errors). However when i use mono develop to run the project the site runs PERFECT. WTF. Any ideas? Server Error in '/' Application A type load exception has occurred. Description: HTTP 500. Error processing request. Stack Trace: System.TypeLoadException: A type load exception has occurred. at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (System.Reflection.MonoMethod*,object,object[],System.Exception&) at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000] in <filename unknown>:0 Version information: Mono Runtime Version: 2.8.1 (tarball Mon Dec 27 10:20:03 UTC 2010); ASP.NET Version: 2.0.50727.1433 Second: Server Error in '/' Application Could not load type 'mynamespace.BaseUser' from assembly 'mynamespace, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'. Description: HTTP 500. Error processing request. Stack Trace: System.TypeLoadException: Could not load type 'mynamespace.BaseUser' from assembly 'mynamespace, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'. at mynamespace.Global.Application_Start (System.Object sender, System.EventArgs e) [0x00000] in <filename unknown>:0 at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (System.Reflection.MonoMethod*,object,object[],System.Exception&) at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000] in <filename unknown>:0 Version information: Mono Runtime Version: 2.8.1 (tarball Mon Dec 27 10:20:03 UTC 2010); ASP.NET Version: 2.0.50727.1433 -edit- i'll mention that i tried MonoDevelops build of my site on both opensuse and my website and i get the exact same problem.

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10  | Next Page >