Search Results

Search found 7 results on 1 pages for 'sudarsanyes'.

Page 1/1 | 1 

  • When will the ValueConverter's Convert method be called in wpf

    - by sudarsanyes
    I have an ObservableCollection bound to a list box and a boolean property bound to a button. I then defined two converters, one that operates on the collection and the other operates on the boolean property. Whenever I modify the boolean property, the converter's Convert method is called, where as the same is not called if I modify the observable collection. What am I missing?? Snippets for your reference, xaml snipet, <Window.Resources> <local:WrapPanelWidthConverter x:Key="WrapPanelWidthConverter" /> <local:StateToColorConverter x:Key="StateToColorConverter" /> </Window.Resources> <StackPanel> <ListBox x:Name="NamesListBox" ItemsSource="{Binding Path=Names}"> <ListBox.ItemsPanel> <ItemsPanelTemplate> <WrapPanel x:Name="ItemWrapPanel" Width="500" Background="Gray"> <WrapPanel.RenderTransform> <TranslateTransform x:Name="WrapPanelTranslatation" X="0" /> </WrapPanel.RenderTransform> <WrapPanel.Triggers> <EventTrigger RoutedEvent="WrapPanel.Loaded"> <BeginStoryboard> <Storyboard> <DoubleAnimation Storyboard.TargetName="WrapPanelTranslatation" Storyboard.TargetProperty="X" To="{Binding Path=Names,Converter={StaticResource WrapPanelWidthConverter}}" From="525" Duration="0:0:2" RepeatBehavior="100" /> </Storyboard> </BeginStoryboard> </EventTrigger> </WrapPanel.Triggers> </WrapPanel> </ItemsPanelTemplate> </ListBox.ItemsPanel> <ListBox.ItemTemplate> <DataTemplate> <Grid> <Label Content="{Binding}" Width="50" Background="LightGray" /> </Grid> </DataTemplate> </ListBox.ItemTemplate> </ListBox> <Button Content="{Binding Path=State}" Background="{Binding Path=State, Converter={StaticResource StateToColorConverter}}" Width="100" Height="100" Click="Button_Click" /> </StackPanel> code behind snippet public class WrapPanelWidthConverter : IValueConverter { public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) { ObservableCollection<string> aNames = value as ObservableCollection<string>; return -(aNames.Count * 50); } public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) { throw new NotImplementedException(); } } public class StateToColorConverter : IValueConverter { public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) { bool aState = (bool)value; if (aState) return Brushes.Green; else return Brushes.Red; } public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) { throw new NotImplementedException(); } }

    Read the article

  • What is "UseRANU" parameter in Visual Studio

    - by sudarsanyes
    I have created a package in VS2010 RC using the MPF (Managed Package Framework) and I get the following error. Can somebody help me out with this ?? The "UseRANU" parameter is not supported by the "VsTemplatePaths" task. Verify the parameter exists on the task, and it is a settable public instance property. The "VsTemplatePaths" task could not be initialized with its input parameters.

    Read the article

  • What is the significance of ProjectTypeGuids tag in the visual studio project file

    - by sudarsanyes
    What is the significance of the ProjectTypeGuids tag in a visual studio project?? When I created a WPF application, i am seeing two guids in here. {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} Does these represent WPF and Windows type of applications? If I create my own project type (.myproj) that has .xaml and .cs files, what should I fill in this ProjectTypeGuids tags? Should I also need to fill the ProjectType tag? It would also be better if someone differentiate the ProjectType and ProjectTypeGuids tags. P.S. I am using Visual Studio 2010 RC currently Thanks

    Read the article

  • Scrolling list items in wpf

    - by sudarsanyes
    I guess the following picture depicts the problem better than texts... That is what I need. <ListBox x:Name="NamesListBox" ItemsSource="{Binding}"> <ListBox.ItemsPanel> <ItemsPanelTemplate> <WrapPanel x:Name="ItemWrapPanel"> <WrapPanel.RenderTransform> <TranslateTransform x:Name="ItemWrapPanelTransformation" X="0" /> </WrapPanel.RenderTransform> <WrapPanel.Triggers> <EventTrigger RoutedEvent="WrapPanel.Loaded"> <BeginStoryboard> <Storyboard> <DoubleAnimation Storyboard.TargetName="ItemWrapPanelTransformation" Storyboard.TargetProperty="X" To="-1000" From="{Binding ElementName=ScrollingListItemsWindow, Path=Width}" Duration="0:0:9" RepeatBehavior="100" /> </Storyboard> </BeginStoryboard> </EventTrigger> </WrapPanel.Triggers> </WrapPanel> </ItemsPanelTemplate> </ListBox.ItemsPanel> <ListBox.ItemTemplate> <DataTemplate> <Grid> <Label Content="{Binding}" /> </Grid> </DataTemplate> </ListBox.ItemTemplate> </ListBox> is what I did. But here I don't wanna hard code -1000 for the X value, rather I want to determine this based on the length of the wrap panel/number of items. Can somebody help me with this ?? Reason why I choose list box is that the number of items can increase and decrease at any time and suits the problem better. If you have got any other idea, please suggest it too. Thanks.

    Read the article

  • Considering HorizontalAlignment and VerticalAlignment while creating a custom panel

    - by sudarsanyes
    I am trying to create a custom panel in wpf. Here the doubts I have, How do I consider the HorizontalAlignment and VerticalAlignment factors while placing the items within my panel. Should I check for these flags in my ArrangeOverride method ?? Consider that I want to write a WrapPanel clone. If the panel's width is set to "Auto", how do I get the actual width of the panel to arrange my child items. I always get the ActualWidth/ActualHeight as 0. Am I missing something??? Please help.

    Read the article

  • Customized bulleted list items in ASP.NET

    - by sudarsanyes
    Hi, I am just a beginner in ASP.NET. My question is simple, I wanna add list items dynamically from the code behind file and I want each item to have a text and couple of images as hyperlinks. The HTML sample should be like, <ul> <li>do foo &nbsp;<a href="#"><img src="some_image.png" /></a></li> <li>do bar &nbsp;<a href="#"><img src="some_image.png" /></a></li> ... </ul> The number of items is dependent on the collection retrieved by the code behind file. P.S. my code behind file is written in C#

    Read the article

1