Bind Listbox Item in Middle which Highest Text(eg.numbers) in wp8

I need to Display Dynamic Data which Contains Text block(text are 90,20,30,50,70).in this case I need display like which is greatest value should be in Middle in List box and second highest should be right side and third highest should be left side ,In Horizontally.

View: 20 50 90 70 30

<ListBox Name="wifiListboxItems" Height="350" Width="467" Canvas.Left="4" HorizontalContentAlignment="Center" SelectionChanged="wifiListboxItems_SelectionChanged_1" ItemsSource="{Binding ItemCollection}" ScrollViewer.HorizontalScrollBarVisibility="Auto" ScrollViewer.VerticalScrollBarVisibility="Disabled"> <ListBox.ItemsPanel> <ItemsPanelTemplate > <wptoolkit:WrapPanel Margin="150,0,150,0" HorizontalAlignment="Center"> </wptoolkit:WrapPanel> </ItemsPanelTemplate> </ListBox.ItemsPanel> <ListBox.ItemTemplate> <DataTemplate> <StackPanel Name="stackpanle" Loaded="stackpanle_Loaded" Orientation="Horizontal" Height="auto" Width="auto"> <Grid Name="gridim"> <Border Height="{Binding Name,Converter={StaticResource HeightConverterTest}}" Width="130" Margin="5" VerticalAlignment="Top" Background="#96345a" CornerRadius="0,0,80,80"/> <Image Name="imgicon" Height="50" Width="50" Stretch="Fill" HorizontalAlignment="Center" Margin="0,40,0,50" VerticalAlignment="Bottom" Source="{Binding AppIcon}"/> <TextBlock Name="tblPer" Text="{Binding Name}" HorizontalAlignment="Center" Margin="0,10,0,0" VerticalAlignment="Top" ></TextBlock> </Grid> </StackPanel> </DataTemplate> </ListBox.ItemTemplate> </ListBox> public class HomePageHeightConverterr:IValueConverter { public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) { string temp = value.ToString(); temp = temp.Remove(temp.Length - 1, 1); double standardHeight = 120; double height; double.TryParse(temp, out height); double returnHeight = standardHeight + (height * 2); return returnHeight; } public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) { throw new NotImplementedException(); } }

here I will get returnHeight like 90,40,60,70,80.Now I have to bind in Listbox which is highest in center ,second highest is in right side and third highest is left side.

Any help could be appreciate?

Category:c# Views:2 Time:2018-09-10

Related post

  • Binding Listbox item source to a collection of collections in windows phone 7 2010-12-21

    I am trying to bind a Listbox ItemSource to a collection of multiple Lists. i.e. List PersonCollection List Person List Collection Now I need to show items from both of these list. In wpf you could use HierarchicalDataTemplate i believe, but not sure

  • Binding ListBox Items using Templates 2011-12-09

    I am going crazy trying to figure this out without success. I have a DependencyObject, ("UserObject"). It has a "DataItems" DependecyProperty that is an ObservableCollection. "UserDefiniton" is a DependencyObject with a DependencyProperty of "Data".

  • How to do Binding ListBox item on runtime? 2011-05-03

    I want to do binding to the items that i get from some web service. I calling the web service method - and i get back some list of strings. I want to do on runtime the binding of those item that i got with the list box. How can i do it ? ------------

  • Using Linq To Convert ListBox Items Values to int 2009-05-13

    I display the contents of a table in the database using a ListBox. Each listbox item is populated with the Text property set to a friendly name, and the Value property set to the unique ID column. The database structure might look similar to the foll

  • binding a command inside a listbox item to a property on the viewmodel parent 2011-02-21

    I've been working on this for about an hour and looked at all related SO questions. My problem is very simple: I have HomePageVieModel: HomePageVieModel +IList<NewsItem> AllNewsItems +ICommand OpenNews My markup: <Window DataContext="{Bindin

  • Silverlight how to use data template selector for listbox items when binding to complex collections 2011-05-11

    I have been looking at samples of DataTemplateSelectors for sivleright and from the examples I have seen the values being returned and evaluated within the Content Control seems to be a single property that has been returned to the listbox from a col

  • How to identify the clicked button belongs to which listbox item? 2012-03-07

    In WPF programming, I have a problem to write the button click event handler. Because the button is inside a listbox item(a part of datatemplate), and when the button is clicked, I can't tell which item it belongs to. Is there any solution? SOS - - -

  • Automatic rolling / scrolling text when text in listbox item is long 2012-03-11

    Suppose I have a long text in a listbox item which can not fit in the screen. I want such text to be automatically rolling so that the user can see the text completely. How can I achieve this? Please help. --------------Solutions------------- Inside

  • Hide content in listbox item depending on a binding property in Silverlight 2009-03-24

    I have xaml that lookes like this <ListBox> <ListBox.ItemTemplate> <DataTemplate> <StackPanel> <TextBlock Text="{Binding Name}" /> <StackPanel Orientation="Vertical" x:Name="contentPanel" > Content goes here...

  • Bind selected item to a text box 2010-04-20

    Hi can anyone tell ..how to bind selected item in list box to textbox.. I used ElementName= Path=.. But nothing is being displayed... --------------Solutions------------- This is how SelectedItem.Content can be done <StackPanel> <TextBlock W

  • bind textblock to current listbox item in pure xaml 2012-02-02

    i have some data saved in a xml file. Those will be displayed in a listbox. Now, when i change the listbox Selectedindex, i would like to update the other information in the textblock based on the selectedindex. is there any way to do this in pure xa

  • Bind observable dictionary to listbox items. [WPF-C#] 2010-11-05

    I try bind observable dictionary to listbox item, and my problem is. If I use normal generic dictionary, it works good. But if I use observable dictionary, listbox items are not loaded. Here is observable dictionary class: public class MyObservableDi

  • Comparing text box text with listbox items text in vb.NET 2010-12-07

    how to Compare text box text with listbox items text in vb.NET....Please HELP --------------Solutions------------- Dim text As String = Me.TxtName.Text For Each item As Object In Me.ListBox1.Items If item.ToString = text Then 'Do something' Else 'Do

  • How get the text from a listbox item? 2011-05-04

    When I try to get the text from a Listbox item in javascript it always returns undefined. winkeloptie.value = winkels[i][0]; winkeloptie.text = (winkels[i][0]); alert(winkeloptie.value) ///This returns the value very nicely alert(winkeloptie.text) //

  • WP7 Get listbox item text 2011-06-20

    Is there a way to get the text of a clicked listbox item? So on click it sets a string to the text in the list box item. --------------Solutions------------- In a new DataBound App, changed the following method to see 3 ways of getting this: // Handl

  • Binding a property to the change the listbox items foreground 2011-11-18

    I have the following ViewModel and I'd like to bind the HotkeysForeground to change the color in the ListBox. namespace Monkey.Core.ViewModel { using System; using System.Collections.ObjectModel; using System.Windows.Media; using Monkey.Core.SystemMo

  • Move the listbox items instead of the "selector bar" 2010-07-07

    1-Is it possible to move the listbox items instead of the "selector bar". In that way, the selector bar has a static position but the items will move. what Im trying to achieve is something like the scrollbar at the bottom of this image: 2-is Listbox

  • Listbox item foreground problem 2009-03-03

    I am facing a problem with one of my XBAP (WPF Browser application) projects: Here I have two list boxes: One a simple list containing text content Second one containing an expander as each item: Now when I click on the item in the first listbox (on

  • Is there a way to iterate in a ListBox Items templates? 2009-03-29

    I have a list box that contains items that are represented by a single textbox. When the user clicks a button, I want to iterate thru all these text boxes and check if their binding expressions are clean of errors; Should be something like: Dim errCo

  • Split the width evenly between of two controls that make up a listbox item? 2009-07-23

    I'm trying to setup a ListBox so that every item has a textblock and a combobox, split evenly across the width of the listbox but I can't seem to find the magic combination of ColumnDefinition properties to do it. Here's my DataTemplate for the listb

  • How to disable a databound ListBox item based on a property value? 2009-12-01

    Does anyone know if and how one can disable items in a databound ListBox based on the value of a property? Preferably I would like a DataTrigger which, when a certain property is false, disables this item (make it impossible to select) without affect

  • DataTemplated ListBox items not responsive to mouse clicks 2010-02-23

    I'm trying to create a ListBox in which the text of the items is bound to the regionName property of the objects in its ItemSource. This is displaying as it should be, but clicking on the text created by the binding does not change the ListBoxItem's

  • How to bind Listbox to two properties? 2010-06-16

    In Silverlight, I have a Grid with DataContext set to class ViewModel. The ViewModel contains list of items (each of them containing int ID and string Text) and an integer "ID", which identifies the currently active item (not selected item). I would

  • How to disable touch selection in listbox item in Windows Phone 7? 2010-10-29

    In the XAML template, I used a listbox to populate some dynamic data. Now I want to disable touch selection in certain listbox items in Windows Phone 7. How to do that ? I had done some little research, some people said that the selection event could

  • WPF Expander in user control getting rendered transparent in ListBox item 2010-11-12

    I’m having issues with a WPF Expander that I have in a user control that gets rendered in a ListBox. Essentially I’m trying to get PopUpButton behavior on each ListItem in my ListBox. When I open the Expander the content is rendering behind everythin

Copyright (C) dskims.com, All Rights Reserved.

processed in 0.184 (s). 11 q(s)