• RELEVANCY SCORE 3.91

    DB:3.91:Can Their Be Textblock Array ? 88




    Hi,

    I want to create textblock array at run and equivalently display it can this be done if Yes, then please can anybody give me example .

    DB:3.91:Can Their Be Textblock Array ? 88

    Yes it can be done in a number of ways, but I don't know where or why you want an array. Can you explain what you are trying to do?http://pauliom.wordpress.com

  • RELEVANCY SCORE 3.30

    DB:3.30:What Is The Property For Keeping Two Controls Aligned? xk




    Is it just with two grids that you can keep their columns aligned (a header grid row and a second grid containing the values)? Or can it be done with a grid and a RichTextBox, too, as I have here:                          StackPanel Orientation=Vertical                            Grid Background=Silver                                 Grid.ColumnDefinitions                                    ColumnDefinition /                                    ColumnDefinition /                                    ColumnDefinition /                                    ColumnDefinition /                                /Grid.ColumnDefinitions                                TextBlockTime/TextBlock                                TextBlock Grid.Column=1Ticket Information/TextBlock                                TextBlock Grid.Column=2Sent/TextBlock                                TextBlock Grid.Column=3Received/TextBlock                            /Grid                            RichTextBox Name=rtbSortStatusRight MinHeight=240 MinWidth=360 Padding=4 Margin=4 IsReadOnly=True VerticalScrollBarVisibility=Auto HorizontalScrollBarVisibility=Auto/RichTextBox                        /StackPanelWriter / Photographer - http://www.feedbooks.com/userbook/3631

    DB:3.30:What Is The Property For Keeping Two Controls Aligned? xk


    From this link:
    http://beta.blogs.microsoft.co.il/blogs/guy/archive/2009/06/30/wpf-grid-shared-size-groups.aspx
    I got the idea to do this:
                            StackPanel Orientation=Vertical                            Grid Background=Silver                                 Grid.ColumnDefinitions                                    ColumnDefinition SharedSizeGroup=TimeCol/                                    ColumnDefinition SharedSizeGroup=TicketInfoCol  /                                    ColumnDefinition SharedSizeGroup=SentCol/                                    ColumnDefinition SharedSizeGroup=RecvdCol/                                /Grid.ColumnDefinitions                                TextBlockTime/TextBlock                                TextBlock Grid.Column=1Ticket Information/TextBlock                                TextBlock Grid.Column=2 TextAlignment=CenterSent/TextBlock                                TextBlock Grid.Column=3 TextAlignment=CenterRecvd/TextBlock                            /Grid                            !--RichTextBox Name=rtbSortStatusRight MinHeight=240 MinWidth=360 Padding=4 Margin=4 IsReadOnly=True VerticalScrollBarVisibility=Auto HorizontalScrollBarVisibility=Auto/RichTextBox--                            Grid Name=gridTimeTicketInfoSentRecvd                                 Grid.ColumnDefinitions                                    ColumnDefinition SharedSizeGroup=TimeCol/                                    ColumnDefinition SharedSizeGroup=TicketInfoCol  /                                    ColumnDefinition SharedSizeGroup=SentCol/                                    ColumnDefinition SharedSizeGroup=RecvdCol/                                /Grid.ColumnDefinitions                             /Grid                        /StackPanel

    Writer / Photographer - http://www.feedbooks.com/userbook/3631
    And you may want to set the IsSharedSizeScope attached property at the grids' parent. It is importantly related to the SharedSizeGroup property.Best regards,JiePlease remember to mark the replies as answers if they help and unmark them if they provide no help.
    If you have any feedback, please tell us.
    The CodeFx Project
    My Blog (in Simplified Chinese)

  • RELEVANCY SCORE 3.16

    DB:3.16:Resizable Textblock ac




    Hello,
    Can someone help me in creating a resizable TextBlock. The TextBlock should be such that if the text is small than it should fit within the TextBlock but if the text is more than the textblock size is increased and if the text size is very large and exceeds
    the maximum textblock size then the text font size is decreased to fit in the textblock.
    How can the textblock size be increased or decreased based on text size and how can the text font be decreased to fit in the textblock once it reaches the maximum textblock size.

    Thanks in advance

    DB:3.16:Resizable Textblock ac

    Hi Paul,
    I started the resizing of the text by using the converters as mentioned by you and it works fine.Thanks a lot.
    Hi mSpot,
    I tried using ViewBox with TextBlock placed in and it works great.But in my case I need to see that the height is fixed and the max and min width is maintained. But facing issue with the maxwidth. When the content increases the width doesnot increase.What
    may be the issue.
    Viewbox Stretch=Uniform MaxWidth=300 MinWidth=150 MaxHeight=90 Height=90 Width=150
    Button x:Name=btnView Content=Berlin g FontSize=60 VerticalContentAlignment=Center HorizontalContentAlignment=Left/
    /Viewbox
    Please help.

  • RELEVANCY SCORE 3.07

    DB:3.07:How To Display A Textblock With 1 Column Inside The Textblock With 2 Column In Grid Using Xaml j7


    I am
    silverlight xaml and c# beginner. I have a nesting situation where i want to display a textblock with 1 column inside the text block with 2 columns in the grid. The view must be like this:

    You can see that there is small algo for it
    Grid
    {
    2 columns for first 3 TextBlock from row 0 to 2
    Only 1 column for the third row // I do so because here the data inside will be more(not able to cover in 1 line)
    Again 2 columns for third TextBlock
    }
    What i tried :
    Grid Width=300
    Grid.RowDefinitions
    RowDefinition Height=20 /
    RowDefinition Height=20 /
    RowDefinition Height=20 /
    RowDefinition Height=20 /
    RowDefinition Height=20 /
    RowDefinition Height= /
    RowDefinition Height=20 /
    RowDefinition Height=20 /
    /Grid.RowDefinitions
    Grid.ColumnDefinitions
    ColumnDefinition Width=* /
    ColumnDefinition Width=* /
    /Grid.ColumnDefinitions
    TextBlock Grid.Row=0 Grid.Column=0 Text=Name /
    TextBlock Grid.Row=0 Grid.Column=1 Text={Binding Name} /

    TextBlock Grid.Row=1 Grid.Column=0 Text=Author /
    TextBlock Grid.Row=1 Grid.Column=1 Text={Binding Author} /

    TextBlock Grid.Row=2 Grid.Column=0 Text=Date of Creation /
    TextBlock Grid.Row=2 Grid.Column=1 Text={Binding DateCreation} /

    TextBlock Grid.Row=3 Grid.Column=0 Text=Company /
    TextBlock Grid.Row=3 Grid.Column=1 Text={Binding Company} /

    TextBlock Grid.Row=4 Grid.Column=0 Text=Description /
    TextBlock Grid.Row=4 Grid.Column=1 Text={Binding Description} /

    !--TextBlock Grid.Row=4 Grid.Column=1 Text={Binding Description}/--

    TextBlock Grid.Row=6 Grid.Column=0 Text=DocUrl /
    TextBlock Grid.Row=6 Grid.Column=1 Text={Binding DocUrl} /

    TextBlock Grid.Row=7 Grid.Column=0 Text=ProgramId /
    TextBlock Grid.Row=7 Grid.Column=1 Text={Binding ProgramId} /

    /Grid

    But the problem with it is it shows 2 columns in all row whereas i want the third row with only 1 column and how to grow its sixe until all the text assigned
    on binding is not accomodatted in it.How to achieve it using Xaml ?

    Please not that i am working in silverlight 5

    DB:3.07:How To Display A Textblock With 1 Column Inside The Textblock With 2 Column In Grid Using Xaml j7

    Sorry but It just keeps on increasing the width but i want to increase height keeping width constant and the text must change the line as it exceeds the width (instead of crossing the border and etting disappear or increasing the width) ;because
    it looks odd that width increases just due to one text box .

  • RELEVANCY SCORE 3.05

    DB:3.05:Can Handlers Of Controls Be Styled? dk


    For example, if I want all TextBlock controls useTextBlock_PointerEntered as the event handler for the pointer entered event, canTextBlock_PointerEntered but put in the the style block for TextBlock?

    Hong

    DB:3.05:Can Handlers Of Controls Be Styled? dk

    Two options would be to create a subclass of the TextBlock with the handlers included or to loop through and add the handlers programmatically.

  • RELEVANCY SCORE 2.96

    DB:2.96:Datagrid Header Style xd


    Dear Experts
    i need the Datagrid Header height should be incresed and header should be wrapped, here i created a style
    Style TargetType=sdk:DataGridColumnHeader
    Setter Property=ContentTemplate
    Setter.Value
    DataTemplate

    TextBlock Text=dfdfdfdfsfsdfdfdfdfdfdfdfdfdf Height=40 Width=100 TextWrapping=Wrap/
    /DataTemplate
    /Setter.Value
    /Setter
    /Style
    but ineed this C#
    Style myStyle = new System.Windows.Style(typeof(DataGridColumnHeader));
    TextBlock tb = new TextBlock();
    System.Windows.DataTemplate myTemplate = new System.Windows.DataTemplate(typeof(TextBlock));
    tb.Text =fkdjfkldjfkljdf;
    tb.Height =40.0;
    tb.Width = 100.0;
    tb.TextWrapping = TextWrapping.Wrap ;
    myTemplate.LoadContent();
    myTemplate ------------------------------- here i dont know how to assign
    myStyle.Setters.Add(new Setter
    {
    Property = DataGridColumnHeader.ContentProperty,
    Value = myTemplate
    });

    myGrid.ColumnHeaderStyle = myStyle;

    Can any one tell the solution
    Thanks in Advance

    DB:2.96:Datagrid Header Style xd

    Hi,
    You could modify my first post as below, it changes the sb.Append() content, it works on my local, and bring the text in center. Please try it, hope it will help.
    public partial class MainPage : UserControl
    {
    public class Student
    {
    public string id { get; set; }
    public string name { get; set; }
    }
    public MainPage()
    {
    InitializeComponent();
    StringBuilder sb = new StringBuilder();
    sb.Append(@ControlTemplate xmlns='http://schemas.microsoft.com/winfx/2006/xaml/presentation' xmlns:sdk='http://schemas.microsoft.com/winfx/2006/xaml/presentation/sdk' TargetType='sdk:DataGridColumnHeader');
    sb.Append(@Grid TextBlock Text='This' Width='100' TextWrapping='Wrap' HorizontalAlignment='Stretch' TextAlignment='Center' VerticalAlignment='Center' //Grid /ControlTemplate);
    Style newGridHeaderStyle = new Style(typeof(DataGridColumnHeader));
    newGridHeaderStyle.Setters.Add(new Setter { Property = DataGridColumnHeader.TemplateProperty, Value = (ControlTemplate)XamlReader.Load(sb.ToString()) });
    dd.ColumnHeaderStyle = newGridHeaderStyle;
    ListStudent Students = new ListStudent();
    Students.Add(new Student() { id = 20091325, name = Jimmy });
    Students.Add(new Student() { id = 20101523, name = Mike });
    dd.ItemsSource = Students;
    }
    }
    Best Regards

  • RELEVANCY SCORE 2.94

    DB:2.94:Set Textblock Width Dynamically 78


    Hi,
    How to Set TextBlock width dynamically using Data binding...
    Here is Scenario:
    I havecreatedUserControl as:
    ---------------------------
    | TextBlock TextBox |
    ---------------------------
    TextBlock.Text will be decided at runtime. And multipleinstances of user control will be placed into window.
    Now, I want to arrange All TextBlocks to Left aligned and TextBoxes should be in the sameline.
    -----------------------------------------------
    Window
    UserControl1
    ------------------------------------------------
    TextBlockContent1 TextBox |
    ------------------------------------------------
    UserControl2
    ------------------------------------------------
    Second_____TextBoxContent TextBox |
    -----------------------------------------------
    -----------------------------------------------

    To do this i will have to set the TextBlock Width Dynamically. Can somebody suggest how to set width of dynamically using DataBinding/Dependency properties.

    Thnanks.

    DB:2.94:Set Textblock Width Dynamically 78

    Thanks Rahul,
    Your suggestion is appropriate for my problem.

  • RELEVANCY SCORE 2.94

    DB:2.94:Listviews In Stackpanels Vs. Listviews In Grids xm


    Forum,
    So I have a ListView, and I was using in a StackPanel until I ran into a situation in which the ListView ran off the bottom of my Page. I can switch this to a Grid without much trouble, but I struggle to understand why the ListView (as styled in one
    of the project templates) behaves so much differently between the two. When I have XAML like this:
    Grid Grid.Row=1
    Grid.RowDefinitions
    RowDefinition Height=50/
    RowDefinition Height=*/
    /Grid.RowDefinitions
    TextBlockWinner winner/TextBlock
    ListView Grid.Row=1
    TextBlock Text=1/
    TextBlock Text=2/
    TextBlock Text=1/
    TextBlock Text=2/
    TextBlock Text=1/
    TextBlock Text=2/
    TextBlock Text=1/
    TextBlock Text=2/
    TextBlock Text=1/
    TextBlock Text=2/
    TextBlock Text=1/
    TextBlock Text=2/
    TextBlock Text=1/
    TextBlock Text=2/
    TextBlock Text=1/
    TextBlock Text=2/
    TextBlock Text=1/
    TextBlock Text=2/
    /ListView
    /Grid
    The layout appears with the line of text and the list of items with a scroll bar as expected. However, when I change it to use a StackPanel, like this:
    StackPanel Grid.Row=1
    TextBlockWinner winner/TextBlock
    ListView
    TextBlock Text=1/
    TextBlock Text=2/
    TextBlock Text=1/
    TextBlock Text=2/
    TextBlock Text=1/
    TextBlock Text=2/
    TextBlock Text=1/
    TextBlock Text=2/
    TextBlock Text=1/
    TextBlock Text=2/
    TextBlock Text=1/
    TextBlock Text=2/
    TextBlock Text=1/
    TextBlock Text=2/
    TextBlock Text=1/
    TextBlock Text=2/
    TextBlock Text=1/
    TextBlock Text=2/
    /ListView
    /StackPanel
    I get a situation in which the ListView just runs downward past the bounds of the page, with no scroll bar. I've looked at some previous discussions about styling ListViews with VirtualizingStackPanels, but I'm not sure how those discussions apply here, if
    they do. I want to understand why the layout behaves like this; can someone please explain why the StackPanel lets this happen?

    DB:2.94:Listviews In Stackpanels Vs. Listviews In Grids xm

    So I take this to mean that star sizing is a form of definite sizing, and that Auto sizing is indefinite. In that case, I was able to bind the containing StackPanel to the row's ActualHeight, and that seemed to work to actually make the ListView
    the right size given the above XAML.
    Unfortuantely, this doesn't solve the other problem I was having: I need a ListView to be a different size in full view versus when it is in snapped view, but this height is based on how big the screen is 9star-sizing). I have not yet been able to
    get this to work in XAML. Is that a question for a different thread?

  • RELEVANCY SCORE 2.94

    DB:2.94:Horizontal Scrolling Is Broken In Listview s3


    Horizontal Scrolling is broken. The problem appears to be in the ItemsStackPanel which provides the default panel for this control. Here's a simple chunk of code to reproduce the problem:
    Page x:Class=App2.MainPage
    xmlns:d=http://schemas.microsoft.com/expression/blend/2008
    mc:Ignorable=d
    xmlns:local=using:App2
    xmlns:mc=http://schemas.openxmlformats.org/markup-compatibility/2006
    xmlns:x=http://schemas.microsoft.com/winfx/2006/xaml
    xmlns=http://schemas.microsoft.com/winfx/2006/xaml/presentation
    Page.Resources
    Style x:Key=TextBlock
    TargetType=TextBlock
    Setter Property=FontSize
    Value=24/
    Setter Property=Margin
    Value=50, 10/
    /Style
    /Page.Resources
    Grid Background={ThemeResource ApplicationPageBackgroundThemeBrush}
    ListView Background=White
    Height=100
    Width=1000
    ScrollViewer.HorizontalScrollBarVisibility=Visible
    ScrollViewer.HorizontalScrollMode=Enabled
    Foreground=Black
    ListView.Items
    StackPanel Orientation=Horizontal
    TextBlock Text=Line 1:
    Foreground=Red
    Style={StaticResource TextBlock}/
    TextBlock Text=Column One
    Style={StaticResource TextBlock}/
    TextBlock Text=Column Two
    Style={StaticResource TextBlock}/
    TextBlock Text=Column Three
    Style={StaticResource TextBlock}/
    TextBlock Text=Column Four
    Style={StaticResource TextBlock}/
    /StackPanel
    StackPanel Orientation=Horizontal
    TextBlock Text=Line 2:
    Foreground=Red
    Style={StaticResource TextBlock}/
    TextBlock Text=Column One
    Style={StaticResource TextBlock}/
    TextBlock Text=Column Two
    Style={StaticResource TextBlock}/
    TextBlock Text=Column Three
    Style={StaticResource TextBlock}/
    TextBlock Text=Column Four
    Style={StaticResource TextBlock}/
    /StackPanel
    StackPanel Orientation=Horizontal
    TextBlock Text=Line 1:
    Foreground=Red
    Style={StaticResource TextBlock}/
    TextBlock Text=Column One
    Style={StaticResource TextBlock}/
    TextBlock Text=Column Two
    Style={StaticResource TextBlock}/
    TextBlock Text=Column Three
    Style={StaticResource TextBlock}/
    TextBlock Text=Column Four
    Style={StaticResource TextBlock}/
    /StackPanel
    /ListView.Items
    /ListView
    /Grid
    /Page
    Unfortunately, using a WrapGrid or VirtualizingStack panel isn't an option as the StackPanel.Header properties don't want to cooperate. I could use some ideas for a work-around.

    DB:2.94:Horizontal Scrolling Is Broken In Listview s3

    Sagar,
    Yes, it is an option. I basically had to roll my own scroll viewer. It was a three day effort to get it all working properly (four if you count the day it took me to figure out that the ItemStackPanel was broken). It would be much better
    to have this built into the framework. I suspect I'm not the only developer in the world who needs a non-scrolling header above a scrollable region.

  • RELEVANCY SCORE 2.89

    DB:2.89:Databinding To An Array Of Strings cp


    Hi.
    I know that it is possible to bind a Listbox to a list of objects like that:

    ListBox x:Name=LB1

    ListBox.ItemTemplate

    DataTemplate

    StackPanel

    TextBlock Text={Binding
    id} Grid.Row=0 Grid.Column=0
    Width=30 Foreground=Black Opacity=1/TextBlock
    TextBlock
    Text={Binding name}/TextBlock
    /Grid
    /StackPanel
    /DataTemplate

    /ListBox.ItemTemplate

    /ListBox

    But that's not exactly what i'm trying to do. I'm trying to bind this to an array of strings, where string [0][x] is the id and string[1][x] is name. By just substituting the List of objects by the array of strings the listbox
    shows no data, probably because there are no specifications which data is name and which is id, I think.

    Can you please help me?

    DB:2.89:Databinding To An Array Of Strings cp

    No, I don't think it is.
    I tried the Dictionary(Of type, type) suggestion as posted above and while this works great for getting a value from a Dictionary, it doesn't help with keeping the control up to date with changes to the value stored at that key.
    So, if you have a Text={Binding NarrativeDictionary.ShortDesc} this will pick out the value stored with the key ShortDesc, but if this stored value changes it doesn't then get changed in the control.

    In short, Dictionary doesn't support INotifyPropertyChanged in the way that ObservableCollection does but ObservableCollection isn't keyed.
    Can we have a keyed version of ObservableCollection?
    Also with the example Text={Binding NarrativeDictionary.ShortDesc} , if NarrativeDictionary is a property of a class which does support INotifyPropertyChanged and you raise the event for the NarrativeDictionary property, it doesn't rebind.

  • RELEVANCY SCORE 2.88

    DB:2.88:Wrapping Textblocks Within A Panorama Item 8j


    I'm trying to wrap textblocks with different backgroundswithin a panoramaitem but it doesn't seem to work in my app.
    How can this be fixed?
    phone:PanoramaItem Header=item1
    toolkit:WrapPanel
    Grid Background=Black
    TextBlock Text=First Example TextBlock Foreground=#FFFFCC00/
    /Grid
    Grid
    TextBlock Text=and Second Example TextBlock Foreground=Black/
    /Grid
    /toolkit:WrapPanel
    /phone:PanoramaItem

  • RELEVANCY SCORE 2.88

    DB:2.88:What Is The Difference Between: Int[][] Arr; And Int[,] Arr; ja



    int[][] is an array of arrays, where array[0] could be 42 items long, and array[1] could have just 2 as each individual inner array can be created independently


    int[,] has a predefined width and height (so you don't need to check bounds for each column), and is internally just one array, so is generally going to be slightly faster


    Both have their uses though, so you may still want to try both to see which fits your use case better

    DB:2.88:What Is The Difference Between: Int[][] Arr; And Int[,] Arr; ja



    cool thanks, well it's for a procedural sphere terrain set up in the editor. Performance will not be that important here (yet). Hehe the progressbar slows things down when creating 65000 verts




    For grids the arr[,] would be preferred then. However I always use arr[ y * depth + x ] wich propably is a bit faster too. Not sure there




    Alex

  • RELEVANCY SCORE 2.88

    DB:2.88:Scrollviewer Issue With Silverlight Page 97


    Folks,
    I would appricate if some one can help me to fix this issue.
    I am working a SilverlightBusiness Template and added one new page over there. Designed that page using controls. you can see that code here. it shows the scroll bar but not able to down the page. and also its shows a like a different panel not at the IE
    vertical scroll bar.

    navigation:Page
    xmlns:my1=clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Input.Toolkit
    xmlns:my=clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls
    x:Class=PatientPortal.Views.RequestAppointment

    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:navigation=clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Navigation
    Title=Request
    Appointment Page

    Style={StaticResource
    PageStyle}
    Height=Auto
    Width=Auto

    Grid
    x:Name=LayoutRoot
    Height=Auto
    Width=Auto

    ScrollViewer
    x:Name=PageScrollViewer
    VerticalScrollBarVisibility=Visible

    ScrollContentPresenter

    Canvas
    VerticalAlignment=Stretch
    HorizontalAlignment=Stretch
    Margin=4
    Height=Auto
    Width=Auto

    Border
    BorderBrush=Blue
    BorderThickness=12,4
    CornerRadius=10
    Background=LightBlue
    Padding=4
    Margin=4
    Canvas.Left=400
    Canvas.Top=20
    Height=Auto
    Width=Auto

    StackPanel
    Orientation=Vertical
    Background=Azure
    VerticalAlignment=Stretch
    Margin=4
    Height=Auto
    Width=Auto

    StackPanel
    Orientation=Horizontal
    Margin=4
    TextBlock
    Style={StaticResource
    ContentTextStyle}
    TextWrapping=Wrap
    Width=500
    Margin=4Bold
    Foreground=RedPlease
    Note: /BoldThis
    screen is used only to make appointments for the member currently logged in.
    Appointment requests made here are only for services provided by the hospital requests for appointments with a physician must be made directly with the physician's office. Appointment requests must be made atleast 2 business days out. If you require scheduling
    an appointment sooner, please call our scheduling department at (512) 753- 3661./TextBlock

    /StackPanel

    StackPanel
    Margin=4

    TextBlock
    Style={StaticResource
    HeaderTextStyle}
    Margin=4Patient
    Information/TextBlock

    /StackPanel

    StackPanel
    Orientation=Horizontal
    Margin=4

    TextBlock
    Width=150
    Margin=4Patient
    First Name:/TextBlock

    TextBox
    x:Name=txtFirstName
    Width=200
    Margin=4/TextBox

    /StackPanel

    StackPanel
    Orientation=Horizontal
    Margin=4

    TextBlock
    Width=150
    Margin=4Patient
    Last Name:/TextBlock

    TextBox
    x:Name=txtLastName
    Width=200
    Margin=4/TextBox

    /StackPanel

    StackPanel
    Orientation=Horizontal
    Margin=4

    TextBlock
    Width=150
    Margin=4Contact
    Email Address:/TextBlock

    TextBox
    x:Name=txtEmail
    Width=200
    Margin=4/TextBox

    /StackPanel

    StackPanel
    Orientation=Horizontal
    Margin=4

    TextBlock
    Width=150
    Margin=4Contact
    Phone:/TextBlock

    TextBox
    x:Name=txtPhone
    Width=200
    Margin=4/TextBox

    /StackPanel

    StackPanel
    Orientation=Horizontal
    Margin=4

    TextBlock
    Width=150
    Margin=4Patient
    Date of Birth :/TextBlock

    TextBox
    x:Name=txtDateOfBirth
    Width=200
    Margin=4/TextBox

    /StackPanel

    StackPanel
    Orientation=Horizontal
    Margin=4

    TextBlock
    Width=150
    Margin=4Patient
    SSN :/TextBlock

    TextBox
    x:Name=txtSSN
    Width=200
    Margin=4/TextBox

    /StackPanel

    StackPanel
    Orientation=Horizontal
    Margin=4

    TextBlock
    Width=150
    Margin=4Prefered
    Time of Contact :/TextBlock

    ComboBox
    Height=30
    Name=cbPreferedTimeofContact
    Width=200
    Margin=4/

    /StackPanel

    StackPanel
    Orientation=Horizontal
    Margin=4

    TextBlock
    Width=150
    Margin=4Insurence
    Company Name:/TextBlock

    TextBox
    x:Name=txtInsurence
    Width=200
    Margin=4/TextBox

    /StackPanel

    StackPanel
    Orientation=Horizontal
    Margin=4

    TextBlock
    Width=400
    Margin=4If
    your insurance company requires a referal, do you have one?/TextBlock

    /StackPanel

    StackPanel
    Orientation=Horizontal
    Margin=4

    RadioButton
    x:Name=rdYes
    Content=Yes
    Margin=4/RadioButton

    RadioButton
    x:Name=rdNo
    Content=No
    Margin=4/RadioButton

    RadioButton
    x:Name=rdNotApplicable
    Content=Not Applicable
    Margin=4/RadioButton

    /StackPanel

    StackPanel
    Orientation=Horizontal
    Margin=4

    TextBlock
    Width=150
    Height=30
    TextWrapping=Wrap
    Margin=4What
    type of appointment are you requestion?/TextBlock

    ComboBox
    x:Name=cbTypeOfAppointment
    Width=200
    Height=30
    Margin=4/ComboBox

    /StackPanel

    StackPanel
    Orientation=Horizontal
    Margin=4

    TextBlock
    Style={StaticResource
    HeaderTextStyle}
    Margin=4Appointment
    Information/TextBlock

    /StackPanel

    StackPanel
    Orientation=Horizontal
    Margin=4

    TextBlock
    Width=150
    Margin=4Refering
    Physician Name :/TextBlock

    TextBox
    x:Name=txtPhysicianName
    Width=200
    Margin=4/TextBox

    /StackPanel

    StackPanel
    Orientation=Horizontal
    Margin=4

    TextBlock
    Width=150
    Margin=4Reason
    for visit :/TextBlock

    ComboBox
    x:Name=cbReasonforVisit
    Height=30
    Width=200
    Margin=4/ComboBox

    /StackPanel

    StackPanel
    Orientation=Horizontal
    Margin=4

    TextBlock
    Width=150
    TextWrapping=Wrap
    Margin=4Symptoms/Reasons
    for Appointment :/TextBlock

    TextBox
    x:Name=txtSymptoms
    Width=250
    AcceptsReturn=True
    VerticalScrollBarVisibility=Visible
    Height=100
    Margin=4/TextBox

    /StackPanel

    StackPanel
    Orientation=Horizontal
    Margin=4

    TextBlock
    Width=100
    Margin=4Prefered
    Date1 :/TextBlock

    my:DatePicker
    x:Name=dpDate1
    Width=100
    Margin=4/my:DatePicker

    TextBlock
    Width=30/TextBlock

    TextBlock
    Width=100
    Margin=4Prefered
    Time1 :/TextBlock

    my1:TimePicker
    x:Name=tpTime1
    Margin=4/my1:TimePicker

    /StackPanel

    StackPanel
    Orientation=Horizontal
    Margin=4

    TextBlock
    Width=100
    Margin=4Prefered
    Date2 :/TextBlock

    my:DatePicker
    x:Name=dpDate2
    Width=100
    Margin=4/my:DatePicker

    TextBlock
    Width=30/TextBlock

    TextBlock
    Width=100
    Margin=4 Prefered
    Time2 :/TextBlock

    my1:TimePicker
    x:Name=tpTime2
    Margin=4/my1:TimePicker

    /StackPanel

    StackPanel
    Orientation=Horizontal
    Margin=4

    TextBlock
    Width=100
    Margin=4Prefered
    Date3 :/TextBlock

    my:DatePicker
    x:Name=dpDate3
    Margin=4
    Width=100/my:DatePicker

    TextBlock
    Width=30/TextBlock

    TextBlock
    Width=100
    Margin=4Prefered
    Time3 :/TextBlock

    my1:TimePicker
    x:Name=tpTime3
    Margin=4/my1:TimePicker

    /StackPanel

    StackPanel
    Orientation=Horizontal
    Margin=4

    TextBlock
    Width=200
    TextWrapping=Wrap
    Margin=4If
    the above times cannot be accomodated, would you take the first available appointment/TextBlock

    RadioButton
    x:Name=rbYes1
    Content=Yes
    Margin=4/RadioButton

    RadioButton
    x:Name=rbNo1
    Content=No
    Margin=4/RadioButton

    /StackPanel

    StackPanel
    Orientation=Horizontal
    Margin=4

    TextBlock
    Width=150
    Margin=4Additional
    Comments :/TextBlock

    TextBox
    x:Name=txtComments
    AcceptsReturn=True
    Width=300
    Height=200
    VerticalScrollBarVisibility=Visible
    Margin=4/TextBox

    /StackPanel

    StackPanel
    Width=100
    HorizontalAlignment=Right
    Margin=4

    Button
    x:Name=Submit
    Click=Submit_Click
    Content=Submit
    Margin=4/Button

    /StackPanel

    /StackPanel

    /Border

    /Canvas

    /ScrollContentPresenter

    /ScrollViewer
    /Grid
    /navigation:Page

    DB:2.88:Scrollviewer Issue With Silverlight Page 97

    Thank you very much thejvk. Its a perfect answer.
    Thanks,
    Ram

  • RELEVANCY SCORE 2.87

    DB:2.87:Scrollbars For Listbox Within Listbox mx


    Hello, I have an problem that I can not solve for quite some time. For simplicity, I have a sample code to demonstrate the idea...
    Grid
    ListBox
    ListBoxItem
    Expander Header=OuteItem
    ListBox
    TextBlockInnerItem/TextBlock
    TextBlockInnerItem/TextBlock
    TextBlockInnerItem/TextBlock
    TextBlockInnerItem/TextBlock
    TextBlockInnerItem/TextBlock
    /ListBox
    /Expander
    /ListBoxItem
    ListBoxItem
    Expander Header=OuteItem
    ListBox
    TextBlockInnerItem/TextBlock
    TextBlockInnerItem/TextBlock
    TextBlockInnerItem/TextBlock
    TextBlockInnerItem/TextBlock
    TextBlockInnerItem/TextBlock
    /ListBox
    /Expander
    /ListBoxItem
    ListBoxItem
    Expander Header=OuteItem
    ListBox
    TextBlockInnerItem/TextBlock
    TextBlockInnerItem/TextBlock
    TextBlockInnerItem/TextBlock
    TextBlockInnerItem/TextBlock
    TextBlockInnerItem/TextBlock
    /ListBox
    /Expander
    /ListBoxItem
    ListBoxItem
    Expander Header=OuteItem
    ListBox
    TextBlockInnerItem/TextBlock
    TextBlockInnerItem/TextBlock
    TextBlockInnerItem/TextBlock
    TextBlockInnerItem/TextBlock
    TextBlockInnerItem/TextBlock
    /ListBox
    /Expander
    /ListBoxItem
    /ListBox
    /Grid
    The OuterItem listbox is scrollable and is just fine. Anyone has any idea how to make InnerItem ListBox scrollable??? Thank you so much!

    DB:2.87:Scrollbars For Listbox Within Listbox mx

    Hi,--The ScrollBar you made visible will always be disabled.Since you did not set a consistent height to the inner ListBox, so the inner ListBox will layout itself in full size. So that you can did not see the enabled ScrlllBar. In order to show the ScrollBar necessary when the viewport is not big enoughto hold the content, you can change the ScrollViewer.HorizontalScrollBarVisibility property value to Auto.--Copy the code and try to resize the window to be smaller, you still won't be able to scroll the inner items...This is because the behavior you resize the window has no impact on the inner ListBox. In this case, you can bind the Height property of the inner ListBox to that of window. when necessary, you can apply a value converter to make the algorithm in the code behind. The following is a example for your reference.XAML code:
    Grid
            Grid.Resources
                local:SizeConverter x:Key=converter /
                Style TargetType=ListBox x:Key=innerStyle
                    Setter Property=Height Value={Binding Converter={StaticResource converter}, Path=ActualHeight,RelativeSource={RelativeSource AncestorType={x:Type Window}}} /
                /Style
            /Grid.Resources
            ListBox Width=300 Height=200
                ListBoxItem
                    Expander Header=OuteItem
                        ListBox  Style={StaticResource innerStyle}
                                 
                            TextBlockInnerItem/TextBlock
                            TextBlockInnerItem/TextBlock
                            TextBlockInnerItem/TextBlock
                            TextBlockInnerItem/TextBlock
                            TextBlockInnerItem/TextBlock
                        /ListBox
                    /Expander
                /ListBoxItem
                ListBoxItem
                    Expander Header=OuteItem
                        ListBox  Style={StaticResource innerStyle}
                            TextBlockInnerItem/TextBlock
                            TextBlockInnerItem/TextBlock
                            TextBlockInnerItem/TextBlock
                            TextBlockInnerItem/TextBlock
                            TextBlockInnerItem/TextBlock
                        /ListBox
                    /Expander
                /ListBoxItem
                ListBoxItem
                    Expander Header=OuteItem
                        ListBox  Style={StaticResource innerStyle}
                            TextBlockInnerItem/TextBlock
                            TextBlockInnerItem/TextBlock
                            TextBlockInnerItem/TextBlock
                            TextBlockInnerItem/TextBlock
                            TextBlockInnerItem/TextBlock
                        /ListBox
                    /Expander
                /ListBoxItem
                ListBoxItem
                    Expander Header=OuteItem
                        ListBox  Style={StaticResource innerStyle}
                            TextBlockInnerItem/TextBlock
                            TextBlockInnerItem/TextBlock
                            TextBlockInnerItem/TextBlock
                            TextBlockInnerItem/TextBlock
                            TextBlockInnerItem/TextBlock
                        /ListBox
                    /Expander
                /ListBoxItem
            /ListBox
    /Grid
    In the code behind:
       public class SizeConverter : IValueConverter
        {
            #region IValueConverter Members
            public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
            {
                return (double)value / 8;
            }
            public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
            {
                throw new NotImplementedException();
            }
            #endregion
        }
    You can also create your own logic to leverage their height.Thanks.Jim Zhou -MSFT

  • RELEVANCY SCORE 2.86

    DB:2.86:Alignment = Stretch And Maxwidth 9k


    If I have a control like a TextBlock contained and it has HorizontalAlignment = Stretch and a MaxWidth set what is the behavior if the TextBlock can be stretched to larger than the MaxWidth.
    In general what is the relationship between Stretch on one hand and Width, MinWidth and Max Width?

    DB:2.86:Alignment = Stretch And Maxwidth 9k

    I'm not sure you are correct about Width. From the documentation here http://msdn.microsoft.com/en-us/library/system.windows.frameworkelement.minwidth(v=vs.110).aspx. If there is a conflict between these values, the order of application for actual
    width determination is first MinWidth must be honored, then MaxWidth, and finally if each of these are within bounds, Width This would imply Width will not be honored if it less than MinWidth.
    Anyway my question was more about what happens when you parent wants to stretch you more than your MaxWidth. Either Stretch gets honored before MaxWidth or visa versa. If MaxWidth is honored what happens to the free space?
    Note that by experiment I believe MaxWidth is honored then the free space is treated as if you were HorizontalAligmnet.Center. However I can't find anything MS has published that confirms this.

  • RELEVANCY SCORE 2.84

    DB:2.84:Property Binding In Xaml sx


    What's the best way to bind a listbox (say) to an arbitrarily-typed property in XAML? For example, let's say I have a TextBlock control and I want the user to be able to select the FontWeight from a listbox. At the moment the best I can come up with is to
    create a wrapper class for each enum and it's corresponding description string:

    public class FontWeightOption
    {
    public string Description { get; set; }
    public FontWeight Weight { get; set; }
    }

    And then in my XAML I declare an array of options for the listbox:

    x:Array Type=my:FontWeightOption x:Key=FontWeightOptions
    my:FontWeightOption Description=Normal Weight=Normal /
    my:FontWeightOption Description=Bold Weight=Bold/
    /x:Array

    And then I set up my textblock and listbox bindings accordingly:

    TextBlock Name=myText FontWeight=NormalA quick brown fox/TextBlock
    ListBox ItemsSource={Binding Source={StaticResource FontWeightOptions}}
    SelectedValue={Binding ElementName=myText, Path=FontWeight}
    SelectedValuePath=Weight DisplayMemberPath=Description/
    Is there any way to do this purely in XAML without that intermediate wrapper class?

    DB:2.84:Property Binding In Xaml sx


    public class FontWeightOptionList
    {
    public struct FontWeightOption
    {
    public string Font { get; set; }
    public string Option { get; set; }
    }
    private static FontWeightOption[] options = new FontWeightOption[]
    {
    new FontWeightOption() { Font=Normal, Option=normal },
    new FontWeightOption() { Font=Bold, Option=bold }

    };

    public IListFontWeightOption Items
    {
    get { return new ListFontWeightOption(options); }
    }
    }
    Roberto Pallucchini
    *** Please mark as Answer, if this reply helps you***

  • RELEVANCY SCORE 2.82

    DB:2.82:Binding Textblock Text Property To A Variable !! 9z


    Hello @ll
    I have got a greate Problem!
    I have also read a many samples and Solutions about it - but nohing really works.
    So I please all of you for help:

    I want to bind a value (mostly a variable oder array-element of type string) to the Text-Property of a textblock in XAML an not programmatically!
    something like this
    TextBlock x:Name=txbl_TXT_BIND Text={Binding DGR}/
    The variable DGR (f.e.) ist decalred on the App.xaml and can also be an Array or simple string-variable.
    When the App starts, all the values will be collected maybe from a Textfile or another database and the be written in the string variable. something like this:

    string DGR = TestEntry;

    I have tried all of the samples around the net, but NOTHING works.
    People present only some code snippets and don´t realy explain how to use them.
    please help me - maybe someone can post an functional example for WP7 or WP8 (better WP7)
    I Need this to Support Orientations in my Phone Apps.
    I deside to build 2 different XAML-Layouts (Grid); one for Portrait-Mode and the other for landscape-mode.
    For this I Need the same Textblock in both Views and this will end in a Nameing Problem because I can´t give the same Name to more than one Element (Textblock) on the same page.
    I need maybe about50 to 200 Textblocks on one Page to Diplay all the Data I Need.
    I hope someone can really help me!

    Thank you

    nice days and mary xmas to all

    Darko

    Darko Grgic (MCSE,MCTS)

    DB:2.82:Binding Textblock Text Property To A Variable !! 9z

    Hello,
    for any Reason the ViewModel did not work for me.
    But the Solution I used is here in this article - it Works for me:
    http://developer.nokia.com/Community/Wiki/Data_Binding_to_controls_on_Windows_Phone

    Thank you guys

    Mary Xmas and happy new year
    Darko
    Darko Grgic (MCSE,MCTS)

  • RELEVANCY SCORE 2.78

    DB:2.78:Textblock Underline To A Width Instead Of The Text Length mk


    I want to underline by textblock, but I want it to underline to length of the textblock. like:
    TextBlock Width=200 Text=A TextDecorations=Underline /
    I want the underline to go to the whole 200 instead of just under A.
    I can put a border around it like
    Border Width=200 BorderThickness=0 0 0 1
    TextBlock Text=A /
    /Border

    But it would be less code if I could just use TextDecorations. Any thoughts?

    DB:2.78:Textblock Underline To A Width Instead Of The Text Length mk

    Thanks for the replys. Textbox is ok, basically looks the same as the border, but the Textbox has a background and mouseover effects I would need to get rid of. I can do that in the styles, but a border would be more flexable for me, plus it's easier to
    change the color and stuff like that.
    There is a difference in that the underline text goes right under. The 'y,q,i .. letters will go slightly under the line. That can probably be duplicated by setting the Height like mentioned above. I'm gonna stick with the border though.

  • RELEVANCY SCORE 2.77

    DB:2.77:Textblock Height 3x


    So, when I have a textBlock heigh set static (hard coded to say 55), I can get the textBlock height properly. But when I have the textBlock height set to auto, and fill the textBlock up I can no longer get the textBlock height properly, it returns a NaN
    (not a number). ?

  • RELEVANCY SCORE 2.77

    DB:2.77:Making A Textbox Scrollable df


    Hi,
    can anybody suggest as howthe text in a textblock can be made scrollable?I have placed the textblock on a rectangle and used another rectangle as a vertical scrollbar..

    DB:2.77:Making A Textbox Scrollable df

    check out this guy's stuff, he's got a really good scrollbar that you can download:
    http://www.vectorform.com/silverlight/

  • RELEVANCY SCORE 2.77

    DB:2.77:Accessing Wp7 Contacts List j1


    I am using some examples to access the Contacts lsit on Wp7.1 I have been able to retrievea specific contacts infofrom the device with

    displayName = an existing contact.

    ListBoxNotes.DataContext =

    from
    Contact con
    in e.Results

    where con.DisplayName == displayName

    select con;

    I can not figure out how to get a text box in the Listbox to show the selected Contacts Notes data. When debugging I can place my cursor over the Datacontext line above and see all the data dor the selected contac, even the notes.

    In the example I saw how they used code below to bind textbox to email array in contacts, but I cannot figure out how to do the same for the notes, maybe I am just trying to make it to difficult
    ListBox.ItemTemplate.
    DataTemplate
    StackPanel
    TextBlock
    Text={Binding Path=EmailAddresses[0].EmailAddress, Mode=OneWay}
    /
    /StackPanel
    /DataTemplate
    /ListBox.ItemTemplate
    I have tried
    TextBlock Text={Binding Notes, Mode=OneWay}
    / Shows text System.Collections.ObjectModel.ReadOnlyCollection instead of notes data in textblock
    TextBlock Text={Binding notes, Mode=OneWay}
    / notheing
    TextBlock
    Text={Binding Path=_notes[0]._items, Mode=OneWay}
    / coencides with info shown in datacontext of listbox in vs2010 nothing is shown
    TextBlock
    Text={Binding Path=_notes, Mode=OneWay}
    / coencides with info shown in datacontext of listbox in vs2010 nothing is shown

    Once the binding is correct I would like the textblock to grow as large as it needs to to show all the notes data also.

    Thanks Jon Stroh

    DB:2.77:Accessing Wp7 Contacts List j1

    Thank you for your help, and the info. It is working great now :)

  • RELEVANCY SCORE 2.76

    DB:2.76:Tool Tip In Wpf 33


    Hi,
    Can any one tell me how to reduce following code length/how to create datatemplate for stack panel given below
    Grid
    Grid.ToolTip

    StackPanel

    StackPanel
    Orientation=Horizontal

    TextBlockName:/TextBlock

    TextBlock
    Text={Binding
    Path=Name}/TextBlock

    /StackPanel

    StackPanel
    Orientation=Horizontal

    TextBlockType:/TextBlock

    TextBlock
    Text={Binding
    Path=Type}/TextBlock

    /StackPanel

    StackPanel
    Orientation=Horizontal

    TextBlockCategory:/TextBlock

    TextBlock
    Text={Binding
    Path=Category.Name,UpdateSourceTrigger=PropertyChanged}/TextBlock

    /StackPanel

    StackPanel
    Orientation=Horizontal

    TextBlockStatus:/TextBlock

    TextBlock
    Text={Binding
    Path=Status}/TextBlock

    /StackPanel

    /StackPanel

    /Grid.ToolTip
    /Grid

    DB:2.76:Tool Tip In Wpf 33

    Or:

    Grid

    Grid.ToolTip

    UniformGrid Columns=2

    TextBlock Text=Name:/

    TextBlock Text={Binding Path=Name}/

    TextBlock Text=Type:/

    TextBlock Text={Binding Path=Type}/

    TextBlock Text=Category:/

    TextBlock Text={Binding Path=Category.Name,UpdateSourceTrigger=PropertyChanged}/

    TextBlock Text=Status:/

    TextBlock Text={Binding Path=Status}/

    /UniformGrid

    /Grid.ToolTip

    /Grid

  • RELEVANCY SCORE 2.76

    DB:2.76:Code From Xaml To C#: Error c8


    Hi,
    I was trying to make an application in WPF when I note that if I create, for example, a TextBox in the page MainWindow.xaml.cs, wether it is in a method, in the constructor or in the class itself, it does not appear.
    I set a lot of properties (like Margin, VerticalAlignement, Text, Height, Visibility) but nothing happens!
    If I create the elements in MainWindow.xaml, I can change their properties in MainWindow.xaml.cs, but if I initialize and fully assign in the C# code they just don't appear independently of how many properties I set!
    I thought Well, maybe I've done something wrong. Let's see some examples in MSDN's Library. and I got this example:

    TextBlock textBlock1 = new TextBlock();
    TextBlock textBlock2 = new TextBlock();

    textBlock1.TextWrapping = textBlock2.TextWrapping = TextWrapping.Wrap;
    textBlock2.Background = Brushes.AntiqueWhite;
    textBlock2.TextAlignment = TextAlignment.Center;

    textBlock1.Inlines.Add(new Bold(new Run(TextBlock)));
    textBlock1.Inlines.Add(new Run( is designed to be ));
    textBlock1.Inlines.Add(new Italic(new Run(lightweight)));
    textBlock1.Inlines.Add(new Run(, and is geared specifically at integrating ));
    textBlock1.Inlines.Add(new Italic(new Run(small)));
    textBlock1.Inlines.Add(new Run( portions of flow content into a UI.));

    textBlock2.Text =
    By default, a TextBlock provides no UI beyond simply displaying its contents.;

    DB:2.76:Code From Xaml To C#: Error c8


    It works!
    But why must I create a StackPanel in the C# code and why can I do the same in XAML without the StackPanel?

    Joo Miguel
    You don't need a StackPanel, but you need some type of container. A Window has one, and only one, child element (Window.Content). By default, when you create a Window in XAML, it adds a Grid as the Content, which allows any number of items to
    be placed in it.
    Try it in xaml - the following is not valid:

    Window ...
    !-- This will cause a compilation error, since youre trying to assign more than one element to Content --
    TextBlock ... /
    TextBlock ... /
    /Window

  • RELEVANCY SCORE 2.76

    DB:2.76:Why Do Targettype Based Styles Not Work On Custom Template Based Controls? a7


    Style triggers are very handy and make our life very simple with WPF. However I am not able to utilize them when I have custom templates for controls. For example this simple style in which I want All the TextBlock occurrences in my UserControl to collapse when they don't have any Text(null/empty) so that they do not occupy space in with in DataTemplate.         Style TargetType={x:Type TextBlock}             Style.Triggers                 Trigger Property=Text Value=                     Setter Property=Visibility Value=Collapsed/                 /Trigger             /Style.Triggers         /Style This would work if my UserControl has simple elements like a series of TextBlocks and some other controls. But say, if I have a TreeView and I a ItemTemplateSelector to display TreeViewItem differently with various HierarchicalDataTemplate. For example one of them being this...             HierarchicalDataTemplate DataType=XYZ ItemsSource ={Binding}                 Grid x:Uid=Grid_7 Width=Auto Height=Auto                     Grid.ColumnDefinitions                         ColumnDefinition/                         ColumnDefinition/                         ColumnDefinition/                         ColumnDefinition/                     /Grid.ColumnDefinitions                     Grid.RowDefinitions                         RowDefinition/                     /Grid.RowDefinitions                                         Image ... Grid.Column=0 Grid.Row=0 Margin=5,0,0,0/                     TextBlock ... Grid.Column=1 Grid.Row=0 Padding=5,0,0,0/                     TextBlock ... Grid.Column=2 Grid.Row=0 Foreground=BluePadding=5,0,0,0/                     TextBlock ... Grid.Column=3 Grid.Row=0 Foreground=RedPadding=5,0,0,0/                                   /Grid             /HierarchicalDataTemplate Now even if I add the style above under TreeView.Resources its never get applied. TextBlocks which have their Text as null/empty still occupy the space in the HierarchicalDataTemplat. Can someone tell me, why doesn't the style gets applied to these HierarchicalDataTemplates? Is it because of design limitations? Or I am using it incorrectly? Any help on this would be appreciated, thank you!

  • RELEVANCY SCORE 2.75

    DB:2.75:Complex (For Me) Sortdescription, Propertygroupdescrition Question 8z


    Ok, this one is becoming a road block to me. I have a class 'Parent' and a child class 'Child'. They are initially loaded into a tree view, no problem. Child can be assigned to multiple parents. To make the application less complicated I only load child
    and off of it I have an array of the parent id's it is assigned to. A group style displays the parent's name in a expander via a converter that gets the parents name by id. All works great. Now I need to sort the groups by the value in their textblock from
    the GroupStyle. Whereas the PropertyGroupDescriptor can handle the list of parent id's the sortdescription cannot be sourced from a list or array. Suggestions? Thanks, Bubba

    DB:2.75:Complex (For Me) Sortdescription, Propertygroupdescrition Question 8z

    Hi BubbaRichard,
    Thank you for your post.
    According to your description, it is hard to knowyourissue and your questions.
    We need some additional information here to be able to determine what is going on. Could you kindly offer more details about your issue? It would
    be appreciated if you could offer a simple ready-to-run sample for us. You could upload it to SkyDrive space and post a link here.
    Have a nice day.Annabella Luo[MSFT]
    MSDN Community Support | Feedback to us

  • RELEVANCY SCORE 2.75

    DB:2.75:Strikethrough Text In Textblock. d3


    Hello everyone!

    I have a problem with TextBlock TextDecorations in silverlight 4.

    As I see, TextDecorations in TextBlock can be only 'Underline', but how I can create 'strikeout' style text?

    Most of people decided to draw Line on the TextBlock, but it isn't working for me, because my TextBlock can Wrap.

    Could You, please, help me create 'strikeout' text in TextBlock, which property TextWrapping set to Wrap?

    Thanks,

    Volodya.

    DB:2.75:Strikethrough Text In Textblock. d3

    Hi Venugopalm,

    Please find my sample project
    here. I hope for your help.

    Thanks,
    Volodya.

  • RELEVANCY SCORE 2.75

    DB:2.75:How Do I Tell If My Textblock Has Wrapped? ac


    I have a need to be able to apply different margins to a TextBlock in th scenario where it has wrapped. Is there a mechanism where I can determine if my TextBlock has so much text that it is wrapped?

    DB:2.75:How Do I Tell If My Textblock Has Wrapped? ac

    I don't believe there is a straightforward IsWrappedmarker for this, or a Wrapped eventunfortunately.
    I can think of a somewhat devious solution, which I have seen used in real apps before, and which takes all the possible runtime variables into account. In your XAML, declare basically a copy of the same TextBlock, with the same Text and other characteristics.
    Excepting for copy, make sure it's TextWrapping=NoWrap and has a different Name.Each TextBlockhas to render at least once in order to get legitimate layout-derived values. Hook a SizeChanged handler to the real TextBlock (the one with wrapping). Now compare
    the ActualWidth values. If the wrapping has kicked in, your real one will have a shorter ActualWidth. You can then adjust your styles or property values appropriately.Finally, set the Visibility of your copy to Collapsed.

  • RELEVANCY SCORE 2.75

    DB:2.75:Why Does Giving A Style An X:Key Value, Disable That Style? 3x


    Hi,
    I'm new to WPF and I'm exploring styles, control templates etc - all very interesting.
    While experimenting I encountered something puzzling, appears to be a problem in WPF.
    I created a style for target type TextBlock then in the window I have TextBlock items both stand alone and within a DataTemplate.
    The TextBlock items rendered by the DataTemplate don't get the style applied but the stand alone TextBlock does, so I searched the web.
    Turns out I can just give the Style its own x:Key and then refer to that in the TextBlock entries within the DataTemplate, that works BUT the stand alone TextBlock is now no longer being styled!
    I did some tests and it seems that if I add an x:Key to a style it no longer gets applied to its target types...
    Is this by design?
    Cap'n

    DB:2.75:Why Does Giving A Style An X:Key Value, Disable That Style? 3x

    In general, setting the TargetType property of a style without assigning the style an x:Key causes the style to be applied to all elements of the type specified by the TargetType attribute.
    However, templates are viewed as an encapsulation boundary and any lookup of a style to be applied to an element that is produced by a template stops at this boundary. This is why the implicit style for the TextBlock doesn't get applied to a TextBlock within
    a DataTemplate whereas it does get applied to a TextBlock that is defined outside the DataTemplate. This is by design and the easiest work around is to assign the style an explicit x:Key and reference it by this key from the TextBlock within the DataTemplate.
    One exception to this rule is that implicit styles that are defined in the application resources (App.xaml) do get applied anyway.
    There are also differences between controls, i.e. elements that have a ControlTemplate, and simple elements. Please refer to the following thread for more information:

    http://social.msdn.microsoft.com/Forums/vstudio/en-US/e014042d-9bfe-4f7d-ae43-769862bb214f/textblock-ignores-style-why?forum=wpf

  • RELEVANCY SCORE 2.75

    DB:2.75:Edit Expander Content In Blend3 zf


    How do I edit expander content in Blend3 on the storyboard. When I have several expanders in the same control, they will not expand so i can see the content. I know I can edit content in properties and w/ VS, but I want to use the spell checker in Blend3.
    Editing indiviual expander contentsworks fine until I put the dockpanel with the image and textblock in the first expander. When I view the page in broswer it works OK.
    navigation:Page
    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:navigation=clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Navigation
    xmlns:controlsToolkit=clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Toolkit
    xmlns:i=clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity

    xmlns:local=clr-namespace:ATPCServices.Classes
    x:Class=ATPCServices.Repair
    Title=Repair Services
    d:DesignWidth=640 d:DesignHeight=480 Width=780 Margin=0 Height=550

    Grid x:Name=LayoutRoot Width=780 Height=550 Margin=0
    Grid.RowDefinitions
    RowDefinition Height=0.573*/
    RowDefinition Height=0*/
    RowDefinition Height=0*/
    RowDefinition Height=0.427*/
    /Grid.RowDefinitions
    Border Height=550 Margin=0 VerticalAlignment=Top BorderThickness=1 Width=780 CornerRadius=3 Grid.RowSpan=4
    Border.BorderBrush
    SolidColorBrush Color={StaticResource ATPCshadow}/
    /Border.BorderBrush
    ScrollViewer VerticalAlignment=Top
    i:Interaction.Behaviors
    local:MouseWheelScrollBehavior /
    /i:Interaction.Behaviors
    StackPanel HorizontalAlignment=Left VerticalAlignment=Top Width=765
    StackPanel.Background
    SolidColorBrush Color={StaticResource ATPCltBlue}/
    /StackPanel.Background
    controlsToolkit:Expander x:Name=Repair_Diagnostics FontFamily=Verdana FontSize=13.333 Header=Repair Diagnostics Style={StaticResource ExpanderStyle1}
    controlsToolkit:DockPanel
    Image Source=Computer_Repair.png Width=181 Height=190 Stretch=Fill controlsToolkit:DockPanel.Dock=Left/
    TextBlock TextWrapping=Wrap controlsToolkit:DockPanel.Dock=RightRun Text=Proper diagnostics can be overlooked in the rush to get a system working again. Witness the technician that swaps out the hard drive only to find out
    that a system file was corrupted and no hardware problem exited, or hours of software troubleshooting wasted only to find out that a flakey RAM memory is the problem./LineBreak/Run Text=/LineBreak/Run Text=A half hour of good diagnostics can save
    you time and money. Good diagnostics not only involves logical incremental tests, but also, an interview with the user(s) and system administrator. What was the most recent system change made before the problem was noticed. Was any hardware or software
    recently installed or upgraded. Information that appears unrelated events can often aid the troubleshooting./LineBreak/Run Text=/LineBreak/Run Text=So the half hour or more spent to gather the right information before starting a repair is an essential
    part of the repair. We can give second opinions before you start an expensive repair.//TextBlock
    /controlsToolkit:DockPanel
    /controlsToolkit:Expander
    controlsToolkit:Expander x:Name=Expander2 FontFamily=Verdana FontSize=13.333 Header=Expander2 Style={StaticResource ExpanderStyle1}
    TextBlock TextWrapping=WrapRun Text=This is a test./LineBreak/Run Text=Test Line 2./LineBreak/Run Text=Test Line 3./LineBreak/Run Text=Test Line 4./LineBreak/Run Text=Test Line 5./LineBreak/Run Text=The quick the quick
    brown fox jumped over the lazy dog's back 1234567890 times. Now is the time for all good men to come to the aid of their party.//TextBlock
    /controlsToolkit:Expander
    controlsToolkit:Expander x:Name=Expander3 FontFamily=Verdana FontSize=13.333 Header=Expander3 Style={StaticResource ExpanderStyle1}
    TextBlock Width=778 TextWrapping=WrapRun Text=This is a test./LineBreak/Run Text=Test Line 2./LineBreak/Run Text=Test Line 3./LineBreak/Run Text=Test Line 4./LineBreak/Run Text=Test Line 5./LineBreak/Run Text=The
    quick the quick brown fox jumped over the lazy dog's back 1234567890 times. Now is the time for all good men to come to the aid of their party.//TextBlock
    /controlsToolkit:Expander
    controlsToolkit:Expander x:Name=Expander4 FontFamily=Verdana FontSize=13.333 Header=Expander4 Style={StaticResource ExpanderStyle1}
    TextBlock Width=778 TextWrapping=WrapRun Text=This is a test./LineBreak/Run Text=Test Line 2./LineBreak/Run Text=Test Line 3./LineBreak/Run Text=Test Line 4./LineBreak/Run Text=Test Line 5./LineBreak/Run Text=The
    quick the quick brown fox jumped over the lazy dog's back 1234567890 times. Now is the time for all good men to come to the aid of their party.//TextBlock
    /controlsToolkit:Expander
    controlsToolkit:Expander x:Name=Expander5 FontFamily=Verdana FontSize=13.333 Header=Expander5 Style={StaticResource ExpanderStyle1}
    TextBlock Width=778 TextWrapping=WrapRun Text=This is a test./LineBreak/Run Text=Test Line 2./LineBreak/Run Text=Test Line 3./LineBreak/Run Text=Test Line 4./LineBreak/Run Text=Test Line 5./LineBreak/Run Text=The
    quick the quick brown fox jumped over the lazy dog's back 1234567890 times. Now is the time for all good men to come to the aid of their party.//TextBlock
    /controlsToolkit:Expander
    controlsToolkit:Expander x:Name=Expander6 FontFamily=Verdana FontSize=13.333 Header=Expander6 Style={StaticResource ExpanderStyle1}
    TextBlock Width=778 TextWrapping=WrapRun Text=This is a test./LineBreak/Run Text=Test Line 2./LineBreak/Run Text=Test Line 3./LineBreak/Run Text=Test Line 4./LineBreak/Run Text=Test Line 5./LineBreak/Run Text=The
    quick the quick brown fox jumped over the lazy dog's back 1234567890 times. Now is the time for all good men to come to the aid of their party.//TextBlock
    /controlsToolkit:Expander
    controlsToolkit:Expander x:Name=Expander7 FontFamily=Verdana FontSize=13.333 Header=Expander7 Style={StaticResource ExpanderStyle1}
    TextBlock Width=778 TextWrapping=WrapRun Text=This is a test./LineBreak/Run Text=Test Line 2./LineBreak/Run Text=Test Line 3./LineBreak/Run Text=Test Line 4./LineBreak/Run Text=Test Line 5./LineBreak/Run Text=The
    quick the quick brown fox jumped over the lazy dog's back 1234567890 times. Now is the time for all good men to come to the aid of their party.//TextBlock
    /controlsToolkit:Expander
    controlsToolkit:Expander x:Name=Expander8 FontFamily=Verdana FontSize=13.333 Header=Expander8 Style={StaticResource ExpanderStyle1}
    TextBlock Width=778 TextWrapping=WrapRun Text=This is a test./LineBreak/Run Text=Test Line 2./LineBreak/Run Text=Test Line 3./LineBreak/Run Text=Test Line 4./LineBreak/Run Text=Test Line 5./LineBreak/Run Text=The
    quick the quick brown fox jumped over the lazy dog's back 1234567890 times. Now is the time for all good men to come to the aid of their party.//TextBlock
    /controlsToolkit:Expander
    /StackPanel
    /ScrollViewer
    /Border
    /Grid
    /navigation:Page

    DB:2.75:Edit Expander Content In Blend3 zf

    I did not mark this as answered. The post marked as answered is not the solution to my problem. I think it has to do with having an image in the expander. The code I posted has several expanders in a vertical stackpanel. The first expander contains a
    dockpanel with an image and a textblock. The remaining expanders have textblocks. In Expression Blend 3 the expanders will not expand when click on with this arrangement. If all the of expanders have text, they expanders expand so you can edit the contents.
    I found that if I select an expander and click on the Font Bold property the expander will expand for editing. Click on other font properties seems to do this as well. This only seems to be a problem with more complex expander content.
    I have been slaying other SL3 dragons lately so I have not had a chance to post a simple example. However, easily duplicated this in other projects. The point of my use of Blend 3 is to have a design editor. However, I find my self doing more and more
    in VS2008 and just using Blend 3 to fiddle with the layout and do animations.
    I'll try to post a better example of this Blend 3 expander editing limitation when I get time.

  • RELEVANCY SCORE 2.75

    DB:2.75:Focus Issues With Textblock cf


    I have a page with a textblock and an AdControl, when the user is typing into the Textblock the AdControl seemsto be stealing focus whenever it downloads an a new ad. This is pretty annoying, is there anyway I can prevent this?

    DB:2.75:Focus Issues With Textblock cf

    Thanks Scott,

    I recommend that you post this to the
    Microsoft pubCenter for Mobile site, in order to engage the folks handling the Ad technology. In the mean time I am alerting them, regarding the unanswered questions

    here.

    Thanks!
    Mark

  • RELEVANCY SCORE 2.75

    DB:2.75:Character Array Converted To Array. cc


    How can a character string of say FFFFFFFFFFFFFFFFFFFFF be coverted to a 1 dimensional array of "FF"(1 byte wide).Thanks

    DB:2.75:Character Array Converted To Array. cc

    Since you don't have a delimiter between the bytes, I think you will have to go over the string in a while loop, and extract 2 characters each time until there are no more left. In each iteration, wire the 2 chars into a String to Hex number VI and auto index the result out of the loop. You have your numeric array. Just click one of the elements and select Visible ItemsRadix and change it to hex.



    ___________________Try to take over the world!

  • RELEVANCY SCORE 2.75

    DB:2.75:Does Anyone Know The Programmatic Equivalent Of This Valid Xaml? xc


    G'day folks
    I'm trying to work out how to nest more than one TextBlock in a Button. I know that using :
    TextBlock tb = new TextBlock();
    tb.SetValue(TextBlock.NameProperty, txt);
    tb.SetValue(TextBlock.TextProperty, txt);
    tb.SetValue(TextBlock.HeightProperty, h);
    tb.SetValue(TextBlock.WidthProperty, w);
    Button btn = new Button() { Height = h, Width = w };
    btn.Content = tb;
    allows me to add *one* child TextBlock to the button, but no more.
    Expression Blend 4 doesn't seem to allow more than one either (in that if I try and create a new one in the same Button, it wipes out the previous one).
    However, in XAML I can do :
    ...
    TextBlock Name=LB HorizontalAlignment=Left TextWrapping=Wrap Text=Left side TextBlock VerticalAlignment=Bottom Margin=10,0,0,10/
    TextBlock Name=RB HorizontalAlignment=Right TextWrapping=Wrap Text=Right side TextBlock VerticalAlignment=Bottom Margin=10,0,0,10/
    TextBlock Name=LT HorizontalAlignment=Left TextWrapping=Wrap Text=Left side TextBlock VerticalAlignment=Top Margin=10,0,0,10/
    TextBlock Name=RT HorizontalAlignment=Right TextWrapping=Wrap Text=Right side TextBlock VerticalAlignment=Top Margin=10,0,0,10/
    /Grid
    /ControlTemplate
    /Setter.Value
    /Setter
    Setter Property=FontFamily Value=/7Metro;component/Fonts/Fonts.zip#Segoe WP/
    Setter Property=FontSize Value=13.333/
    Setter Property=Foreground Value=White/
    /Style
    and it displays all 4 TextBlocks in the Button - I realise this in a Style, which might be different technically - the end effect *seems* to be what I want though.
    If I can't programmatically add more than one, does anyone know how to access the above XAML-defined LB, RB and so on, so that I can alter their Text property at run-time?
    Happy to post more code / XAML if anyone feels its needed to explain things better.

    Many thanks in advance!

    DB:2.75:Does Anyone Know The Programmatic Equivalent Of This Valid Xaml? xc

    The Content property of Button takes an object, so you set the a Grid (orany contentcontainer)as the content and add whatever you like to the Grid.

    Button
    Button.Content
    Grid
    Grid.RowDefinitions
    RowDefinition Height=Auto/
    RowDefinition Height=Auto/
    RowDefinition Height=Auto/
    /Grid.RowDefinitions
    TextBlock Text=1 /
    TextBlock Text=2 Grid.Row=1/
    TextBlock Text=3 Grid.Row=2/
    /Grid
    /Button.Content
    /Button

    This can also be done using code. Just add create a Grid and add the TextBlocks to the Children collection of the grid and set the RowProperty for each of the TextBlocks. (Grid.SetRow(textBlock, 0))

  • RELEVANCY SCORE 2.75

    DB:2.75:Why The Blank In The Mddile Of String Is Removed When The Texttrimming Of Textblock Is Set To Characterellipsis? 1s


    Why the blank in the mddile of string is removed when the TextTrimming of TextBlock is set to CharacterEllipsis? TextBlock TextTrimming=CharacterEllipsis I have a textblock control, and want it to display ... when the content can not be displayed.But if there are some space(blank) in the middle of the content, the blank will be removed.for example, the string ABC                                    DEF will be displayed as following,[ABC...                   ]But I hope it is displayed as following[ABC                  ... ]

    DB:2.75:Why The Blank In The Mddile Of String Is Removed When The Texttrimming Of Textblock Is Set To Characterellipsis? 1s

    Hi Jetsun, trimming by definition means that spaces (or blanks) are being removed. That is, TextTrimming will trim the result of what will actually fit into the visible area and add the dots to the trimmed result. Cheers, Olaf

  • RELEVANCY SCORE 2.75

    DB:2.75:Add New Stackpanel When The Last Is Full 1k


    Hii !
    I would like to create a view with differents objects (textbox, textblock ...), where the user can add more objects.
    I have a code like this :
    StackPanel Grid.Row=1 Grid.Column=1 Grid.RowSpan=2 x:Name=NamePanel

    TextBlock.../TextBlock
    TextBlock.../TextBlock
    TextBlock.../TextBlock
    TextBlock.../TextBlock
    TextBlock.../TextBlock
    Button x:Name=AddSubFieldName Content=Add Click=AddSubFieldNameButtonClick/Button

    /StackPanel

    StackPanel Grid.Row=1 Grid.Column=2 Grid.RowSpan=2 x:Name=MailPanel

    TextBlock.../TextBlock
    TextBlock.../TextBlock
    TextBlock.../TextBlock
    TextBlock.../TextBlock
    TextBlock.../TextBlock
    Button x:Name=AddSubFieldMail Content=Add Click=AddSubFieldMailButtonClick/Button

    /StackPanel

    StackPanel Grid.Row=1 Grid.Column=3 Grid.RowSpan=2 x:Name=AddressPanel

    TextBlock.../TextBlock
    TextBlock.../TextBlock
    TextBlock.../TextBlock
    TextBlock.../TextBlock
    TextBlock.../TextBlock
    Button x:Name=AddSubFieldAddress Content=Add Click=AddSubFieldAddressButtonClick/Button

    /StackPanel
    When the Height of my first and second stackpanel is full i add element on the next stackpanel, but how can i create a new stackpanel when my third stackpanel is full too ? (in adding a scrollbar)
    I hope my question is clear ...
    Thanks a lot

    DB:2.75:Add New Stackpanel When The Last Is Full 1k

    you can get the NuGet package
    http://nuget.org/packages/winrtxamltoolkit/- no need do download the project from Codeplex.
    Just make sure that you have the NuGet Package Manager extension for Visual Studio.
    When you downloaded the package, you can use it in your XAML file like this:
    xmlns:toolkit=using:WinRTXamlToolkit.Controls

    toolkit:WrapPanel
    ...
    /toolkit:WrapPanel

    cheersLife is unsure - always eat the dessert first!

  • RELEVANCY SCORE 2.74

    DB:2.74:Sgd Array Members In Different Time Zones? c1


    Can SGD array members be in different time zones? Both servers have their GMT times synced to ntp, but obviously one is on one time zone, and the other on another.

    When I try to add the secondary to the array I get this:
    [root@amralbvdi01 ~]# /opt/tarantella/bin/tarantella array join --secondary amrsngvdi01.XXXXXXXXXX.com
    Type the username and password of a Secure Global Desktop Administrator
    for amrsngvdi01.XXXXXXXX.com
    Username: root
    Password:
    Couldn't join the server amrsngvdi01.XXXXXXXXX.com.
    Unable to negotiate a secure connection.
    Please check your security settings.
    [root@amralbvdi01 ~]#

    I did confirm the other end has secure intra-array setup.

    DB:2.74:Sgd Array Members In Different Time Zones? c1

    MrBrown: Heres the verbose output, not really that helpful.

    [root@amralbvdi01 ~]# /opt/tarantella/bin/tarantella array join secondary amrsngvdi01.xxxxx.com verbose
    2012/01/20 15:46:22.950(pid 0)server/common/info#1327092382936
    Successful DNS lookup (10.10.1.35).

    2012/01/20 15:46:23.786(pid 0)server/tfn/info#1327092383786
    Creating a TFN table for the flavor "autoAdmin"
    using properties at file:///opt/tarantella/var/serverresources/tfn.

    2012/01/20 15:46:23.869(pid 0)server/tfn/info#1327092383869
    Loading com.sco.tta.common.jndi.provider.tfn.TFNFlavourLogicAdmin
    as logic for determining the TFN flavor.

    2012/01/20 15:46:23.881(pid 0)server/tfn/info#1327092383881
    Looking for ASAD server on amralbvdi01.xxxxxxx.com:5427.

    2012/01/20 15:46:23.890(pid 0)server/tfn/info#1327092383890
    Found an ASAD server on amralbvdi01.xxxxxxx.com:5427.

    2012/01/20 15:46:23.891(pid 0)server/tfn/info#1327092383891
    Creating a TFN table for the flavor "connected-local-master"
    using properties at file:///opt/tarantella/var/serverresources/tfn.

    2012/01/20 15:46:23.926(pid 0)server/tfn/info#1327092383926
    Created a TFN table for the flavor "connected-local-master".

    2012/01/20 15:46:23.974(pid 0)admin/misc/moreinfo#1327092383974
    Contacting host amralbvdi01.xxxxxxxx.com.

    2012/01/20 15:46:23.984(pid 0)admin/misc/moreinfo#1327092383984
    Contacted host amralbvdi01.xxxxxxxxx.com succesfully.

    Type the username and password of a Secure Global Desktop Administrator
    for amrsngvdi01.xxxxxxxxx.com
    Username: root
    Password:
    Couldn't join the server amrsngvdi01.xxxxxxxxxx.com.
    Unable to negotiate a secure connection.
    Please check your security settings.

    config list output:
    [root@amralbvdi01 ~]# /opt/tarantella/bin/tarantella config list
    array-audio-quality: high
    array-audio: 1
    array-billingservices: 0
    array-clipboard-clientlevel: 3
    array-clipboard-enabled: 0
    array-dyndevice: 0
    array-editprofile: 0
    array-externallaservice: 0
    array-failoverenabled: 0
    array-logfilter: */*/*error:jserver%%PID%%_error.log,*/*/*error:jserver%%PID%%_error.jsl,*/*/fatalerror:.../_beans/com.sco.tta.server.log.ConsoleSink,""
    array-maxmonitors: 10
    array-monitortime: 60
    array-port-encrypted: 5307
    array-port-peer: 5427
    array-port-unencrypted: 3144
    array-primaryreturnaction: accept
    array-resourcesync: 1
    array-resubmitfindprimarymax: 3
    array-resubmitfindprimarywait: 60
    array-scard: 1
    array-serialport: 1
    array-unixaudio-quality: medium
    array-unixaudio: 0
    array-unixcdm: 0
    array-windowscdm: 0
    audiope-compression: never
    chpe-compression: auto
    chpe-compressionthreshold: 256
    chpe-exitafter: 60
    cpe-args: ""
    cpe-exitafter: 60
    cpe-maxsessions: 20
    cpe-maxusers: 1
    execpe-args: ""
    execpe-exitafter: 60
    execpe-maxsessions: 10
    execpe-maxusers: 1
    execpe-scriptdir: %%INSTALLDIR%%/var/serverresources/expect
    iope-compression: never
    launch-allowsmartcard: true
    launch-alwayssmartcard-initial: checked
    launch-alwayssmartcard-state: enabled
    launch-details-initial: hidden
    launch-details-showonerror: true
    launch-details-state: enabled
    launch-expiredpassword: manual
    launch-loadbalancing-algorithm: sessions
    launch-savepassword-initial: checked
    launch-savepassword-state: enabled
    launch-savettapassword: 1
    launch-showauthdialog: user
    launch-showdialogafter: 2
    launch-trycachedpassword: 1
    login-ad-base-domain: ""
    login-ad-default-domain: ""
    login-ad: 1
    login-anon: 0
    login-atla: 0
    login-autotoken: 0
    login-ens: 1
    login-ldap-thirdparty-ens: 0
    login-ldap-thirdparty-profile: 0
    login-ldap: 0
    login-mapped: 0
    login-nt-domain: ""
    login-nt: 0
    login-securid: 0
    login-thirdparty-ens: 0
    login-thirdparty-nonens: 0
    login-thirdparty-superusers: sgd_trusted_user
    login-thirdparty: 0
    login-unix-group: 1
    login-unix-user: 0
    login-web-tokenvalidity: 180
    login-web-user: ttaserv
    ppe-compression: auto
    ppe-compressionthreshold: 4096
    ppe-exitafter: 240
    printing-mapprinters: 2
    printing-pdfdriver: "HP Color LaserJet 2800 Series PS"
    printing-pdfenabled: 1
    printing-pdfisdefault: 1
    printing-pdfprinter: "Universal PDF Printer"
    printing-pdfprompt: 0
    printing-pdfviewer: "Universal PDF Viewer"
    printing-pdfviewerenabled: 1
    printing-pdfviewerisdefault: 0
    scardpe-compression: never
    security-acceptplaintext: 0
    security-applyconnections: 0
    security-connectiontypes: "ssl,std"
    security-firewallurl: ""
    security-gateway: 172.16.254.41:sgdg:sgdusa.xxxxxxxxxxx.com:443;172.16.160.10:sgdg:sgdusa2.xxxxxxxx.com:443;*:direct:amralbvdi01
    security-newkeyonrestart: 0
    security-peerssl: 1
    security-printmappings-timeout: 1800
    security-ssldaemon-failmode: reducesecurity
    security-xsecurity: 1
    server-dns-external: *:amralbvdi01.xxxxxxxxxxxx.com
    server-logdir: /opt/tarantella/var/log
    server-login: enabled
    server-redirectionurl: ""
    sessions-aipkeepalive: 100
    sessions-loadbalancing-algorithm: .../_beans/com.sco.tta.server.loadbalancing.tier2.LocalLoadBalancingPolicy
    sessions-timeout-always: 11500
    sessions-timeout-session: 1440
    tuning-jvm-initial: 512
    tuning-jvm-max: 512
    tuning-jvm-scale: 150
    tuning-maxconnections: 1000
    tuning-maxfiledescriptors: 4096
    tuning-maxrequests: 14
    tuning-resourcesync-time: 4:00
    webtop-session-idle-timeout: 0
    xpe-args: ""
    xpe-cwm-maxheight: 1280
    xpe-cwm-maxwidth: 3200
    xpe-exitafter: 60
    xpe-fontpath: "%%INSTALLDIR%%/etc/fonts/misc,%%INSTALLDIR%%/etc/fonts/TTF,%%INSTALLDIR%%/etc/fonts/Type1,%%INSTALLDIR%%/etc/fonts/CID,%%INSTALLDIR%%/etc/fonts/local,%%INSTALLDIR%%/etc/fonts/75dpi,%%INSTALLDIR%%/etc/fonts/100dpi,%%INSTALLDIR%%/etc/fonts/ibm,%%INSTALLDIR%%/etc/fonts/hp,%%INSTALLDIR%%/etc/fonts/andrew,%%INSTALLDIR%%/etc/fonts/icl,%%INSTALLDIR%%/etc/fonts/scoterm,%%INSTALLDIR%%/etc/fonts/cyrillic,%%INSTALLDIR%%/etc/fonts/hangul,%%INSTALLDIR%%/etc/fonts/oriental"
    xpe-keymap: client-locale
    xpe-maxsessions: 20
    xpe-maxusers: 1
    xpe-monitorresolution: 0
    xpe-rgbdatabase: %%INSTALLDIR%%/etc/data/rgb.txt
    xpe-sessionstarttimeout: 60
    xpe-tzmapfile: %%INSTALLDIR%%/etc/data/timezonemap.txt

  • RELEVANCY SCORE 2.74

    DB:2.74:Logically Group Controls zz



    There is a grid which has 2 columns and n rows.
    Like below I define n controls in the respective columns and rows..now based on some condition the second column data should be either Hidden or Visible.
    Now that I have already defined these controls as below…looking for some way to group those in Column2 so that we can handle the Visibility of controls by the group’s.
    Is there way out ??
     
    TextBlock Grid.Row=1 Grid.Column=2 Text=Hello /
    TextBlock Grid.Row=2 Grid.Column=2 Text=Hello /
    TextBlock Grid.Row=3 Grid.Column=2 Text=Hello /
    TextBlock Grid.Row=4 Grid.Column=2 Text=Hello /
    TextBlock Grid.Row=5 Grid.Column=2 Text=Hello /
    TextBlock Grid.Row=6 Grid.Column=2 Text=Hello /
    TextBlock Grid.Row=7 Grid.Column=2 Text=Hello /
    TextBlock Grid.Row=8 Grid.Column=2 Text=Hello /
    TextBlock Grid.Row=9 Grid.Column=2 Text=Hello /
    TextBlock Grid.Row=10 Grid.Column=2 Text=Hello /
     
    TextBlock Grid.Row=1 Grid.Column=3 Text=Hello /
    TextBlock Grid.Row=2 Grid.Column=3 Text=Hello /
    TextBlock Grid.Row=3 Grid.Column=3 Text=Hello /
    TextBlock Grid.Row=4 Grid.Column=3 Text=Hello /
    TextBlock Grid.Row=5 Grid.Column=3 Text=Hello /
    TextBlock Grid.Row=6 Grid.Column=3 Text=Hello /
    TextBlock Grid.Row=7 Grid.Column=3 Text=Hello /
    TextBlock Grid.Row=8 Grid.Column=3 Text=Hello /
    TextBlock Grid.Row=9 Grid.Column=3 Text=Hello /
    TextBlock Grid.Row=10 Grid.Column=3 Text=Hello /
     

    DB:2.74:Logically Group Controls zz

    May be better do that by placing controls into some kind of container and manage visibility of container.

  • RELEVANCY SCORE 2.72

    DB:2.72:Stackpanel Childrens Order fk


    Hi I have a for statement for adding textblock childrens to stackpanel. How can i add every new textblock on top of the stack. Now i add textblock like this: TextBlock txtBlock = new TextBlock(); txtBlock.Inlines.Add(newActionString); txtBlock.TextWrapping
    = TextWrapping.Wrap; txtBlock.FontSize = 14; Stack1.Children.Add(txtBlock); And it shows like this: 1 2 3 But it should be like this: 3 2 1 Im so newbie. Thanks

    DB:2.72:Stackpanel Childrens Order fk

    Call the Insert method instead of the Add method.

  • RELEVANCY SCORE 2.72

    DB:2.72:Set Text From Page To Usercontrol Textblock In Metro Style Apps 9f


    Hi.
    I have created UserControl with TextBlock and created a page using Metro style app template. and at the run time i have loaded the usercontrol on page on grid control using GridName.Children.Add(new UserControl()).

    -Now i want set the text from the page to UserControl TextBlock.

    Please help me how it can be done.
    Ravi Shankar

    DB:2.72:Set Text From Page To Usercontrol Textblock In Metro Style Apps 9f

    Thanks.
    It's Working.
    Can you please tell me how can we display text to any UI component from and Class or other threads?
    Regards
    Ravi Shankar

  • RELEVANCY SCORE 2.72

    DB:2.72:Converting A Wpf Templated Listview To Silverlight 3f


    I have created the following in WPF:
    1 DataTemplate x:Key=PostTemplate
    2 Grid
    3 Grid.ColumnDefinitions
    4 ColumnDefinition Width=200/
    5 ColumnDefinition Width=* /
    6 /Grid.ColumnDefinitions
    7 StackPanel
    8 TextBlock FontWeight=Bold FontSize=14 Text={Binding Path=User.DisplayName}/
    9 TextBlock Text={Binding Path=User.Title}/
    10 Rectangle Width=80 Height=80 Fill=DarkGray /
    11 Grid Margin=10,10,10,10
    12 Grid.RowDefinitions
    13 RowDefinition/
    14 RowDefinition/
    15 /Grid.RowDefinitions
    16 Grid.ColumnDefinitions
    17 ColumnDefinition Width=60/
    18 ColumnDefinition/
    19 /Grid.ColumnDefinitions
    20 TextBlockLocation:/TextBlock
    21 TextBlock Grid.Column=1 Text={Binding Path=User.Location}/
    22 TextBlock Grid.Row=1Posts:/TextBlock
    23 TextBlock Grid.Row=1 Grid.Column=14317/TextBlock
    24 /Grid
    25 /StackPanel
    26 Canvas
    27 StackPanel Orientation=Vertical Background={Binding Path=PostType.Color} HorizontalAlignment=Stretch
    28 TextBlock FontSize=12 FontWeight=Bold Foreground=White Margin=0,0,0,0 Padding=20,10,0,0 Text={Binding Path=Title}/
    29 TextBlock FontSize=9 Foreground=White Margin=0 Padding=30,0,0,5 Text={Binding Path=Timestamp}/
    30 /StackPanel
    31 TextBlock TextWrapping=Wrap Text={Binding Path=Text}/
    32 /Canvas
    33 /Grid
    34 /DataTemplate
    35 /UserControl.Resources
    36 Canvas
    37 ListView x:Name=postList HorizontalContentAlignment=Stretch ItemTemplate={StaticResource PostTemplate}/
    38 /Canvas

    However, since ListView is not available in Silverlight, how can I achieve the same effect? I tried ItemsControl, but to no avail. No errors or anything, it just doesn't appear to render. Obviously you'll need the Post datatype for you to try this, but
    it should be rather easy just to replace it with static text.

    DB:2.72:Converting A Wpf Templated Listview To Silverlight 3f

    Hmm.. You are absolutely right. Thanks for your help. It looks weird due to some errors I made in the conversion. It must have something to do with my binding then, I'll work that out.

    Once again, thanks a lot!

  • RELEVANCY SCORE 2.71

    DB:2.71:How To Put Cr Character In Text For Textblock? cc


    I want set two line words for Text property for one TextBlock like:

    Line 1
    Line 2
    How can I do it? hope it can be set like:

    TextBlock Grid.Column=1 Text=Line 1 /n/r Line 2/TextBlock

    DB:2.71:How To Put Cr Character In Text For Textblock? cc

    I tried this way and it gave the output you requested. Add the property TextAlignmnet=Center
    TextBlock Grid.Column=1 TextAlignment=Center

    Run Text=Line 1 Line 1 Line 2/
    LineBreak/
    Run Text=Line 2/

    /TextBlock
    and if this post was helpful then please 'Mark as Answer' - many thanks
    Sharker Khaleed Mahmud (MCPD)
    Software Developer
    This credits that member, earns you a point and marks your thread as Resolved so we will all know you have been helped.

  • RELEVANCY SCORE 2.70

    DB:2.70:Horizontal Scroll On Textblock 9a


    Hello
    How can i make a textblock that hides the first character when one more character is added so that the last one is visible?
    It would be a behaviour similar to the phone dialer.
    I have been trying making a scrollviewer with a textblock with width set to auto, but with this attemp i hvae to manually scroll.

    Thanks

  • RELEVANCY SCORE 2.70

    DB:2.70:Dod Wipe Of A Clariion fk



    I have a customer who bought a new array and wants to sell their old Clariion. They want a DOD wipe of their data off of the old array before they sell it.

    From the old array I plan to...

    I plan to remove all LUNs and RAID GroupsCreate new RAID Groups and LUNSPresent LUNs to a host running WindowsRun some sort of tool (that runs within Windows) similar to DBAN to DOD wipe those Drive Letters/ LUNs

    Is there a better way to do this?

    Can this be done at the Array level without presenting LUNs to Windows?

    DB:2.70:Dod Wipe Of A Clariion fk


    if your question was answered, please mark the question Answered.

    glen

  • RELEVANCY SCORE 2.70

    DB:2.70:Binding Observablecollection To Textblock fd


    Hello, Folks!
    I can bind my observablecollection to listbox, but not to textblock. Here is example:
    TextBlock
    Width=200
    Name=otv1
    Text={Binding
    otv}/TextBlock
    ListBox
    Height=100
    Name=listBox1
    Width=120
    ItemsSource={Binding}
    ListBox.ItemTemplate
    DataTemplate
    TextBlock
    Text={Binding
    Path=otv}/TextBlock
    /DataTemplate
    /ListBox.ItemTemplate
    /ListBox

    listBox1.DataContext = MyCollection;
    otv1.DataContext = MyCollection;

    And I want to move thrue records like in recordset. Isit's possible with observablecollection? Ormay be somehow to use ICollectionView for it?

    DB:2.70:Binding Observablecollection To Textblock fd

    Seems that code realy needs ICollectionView.
    ICollectionView testView;
    CollectionViewSource collViewSource = new CollectionViewSource();
    collViewSource.Source = MyCollection;
    testView = collViewSource.View;
    testView.MoveCurrentToFirst();
    otv1.DataContext = testView.CurrentItem;
    This works for TextBlock!

  • RELEVANCY SCORE 2.70

    DB:2.70:How Do I Programatically Construct A Data Binding? 83


    I am trying to build a custom control that expands on the base TextBlock. I created a UserControl (NewTextBlock) that contains a Label and TextBlock wrapped within a WrapPanel. I also added new Dependency Properties (IsRequired, IsNumeric, MinValue,
    MaxValue) and their validation routinesto the NewTextBlock class. I can now add a NewTextBlock control to the UI and it has a label and new properties.
    My problem is setting the binding for the NewTextBlock. It actually needs to be linked to the internal TextBlock. How would this be accomplished in C#?

    DB:2.70:How Do I Programatically Construct A Data Binding? 83

    It sounds like this MSDN article talks about what you are looking for:
    http://msdn.microsoft.com/en-us/magazine/cc700358.aspx#id0190003

  • RELEVANCY SCORE 2.70

    DB:2.70:Jbutton Array !! jj


    hi,

    How can i add 60 jbuttons to an array and capture their event.

    Thankz

    DB:2.70:Jbutton Array !! jj

    You can try with the following code
    _____________________________

    import javax.swing.JButton;
    import javax.swing.JFrame;
    import javax.swing.JPanel;
    //import javax.swing.F
    import java.awt.Dimension;
    public class ButtonDemo extends JFrame {
    private JButton bt[];
    private JPanel panel;

    public static void main(String args[]) {
    JFrame frame = new ButtonDemo();
    frame.setVisible(true);
    frame.setPreferredSize(new Dimension(600,400));
    frame.setSize(600, 400);
    frame.pack();
    frame.setVisible(true);

    }

    public ButtonDemo() {

    panel = new JPanel();
    bt = new JButton[60];
    for (int i=0 ; i60 ; i++)
    {
    bt[i] = new JButton("Button"+i);
    bt.setPreferredSize( new Dimension( 85 , 30) );
    panel.add( bt[i] );
    }
    getContentPane().add(panel);
    }

    }

  • RELEVANCY SCORE 2.70

    DB:2.70:Change Listbox Selected Item Inside An Item Template From An Outside Event x9


    I have a treeview with an itemtemplate which contains listbox inside of it. It is possible to change the listbox selection from a button? How can it be done?
    Below are my codes:

    TreeView

    controls:TreeView x:Name=treePackage Grid.Column=0 Grid.Row=1 Margin=5
    SelectedItemChanged=treePackage_SelectedItemChanged
    ItemTemplate={StaticResource FrameNodeTemplate}
    ItemContainerStyle={StaticResource FrameNodeTreeViewItem}
    Style={StaticResource FrameNodeTreeView} LayoutUpdated=treePackage_LayoutUpdated /

    ItemTemplate

    common:HierarchicalDataTemplate x:Key=FrameNodeTemplate ItemsSource={Binding Children}
    StackPanel
    Grid Visibility={Binding Converter={StaticResource templateSelector}, ConverterParameter='InstructionSpec'} Margin=5
    Grid.ColumnDefinitions
    ColumnDefinition Width=Auto /
    ColumnDefinition Width=Auto /
    ColumnDefinition /
    /Grid.ColumnDefinitions
    TextBlock ToolTipService.ToolTip={Binding Order} x:Name=txtInsNumber Visibility=Collapsed Loaded=txtInsNumber_Loaded FontSize=14 FontWeight=Bold Margin=0,0,10,0 Grid.Column=0 /
    TextBlock Text=Instruction FontSize=14 FontWeight=Bold Margin=0,0,10,0 Grid.Column=1 /
    StackPanel VerticalAlignment=Center Grid.Column=2
    StackPanel Orientation=Horizontal
    TextBlock Text={Binding InstructionRemarks, Mode=Twoway} TextWrapping=Wrap MaxWidth=310 /
    /StackPanel
    /StackPanel
    /Grid
    Grid Visibility={Binding Converter={StaticResource templateSelector}, ConverterParameter='StimulusSpec'} Margin=5
    Grid.ColumnDefinitions
    ColumnDefinition Width=Auto /
    ColumnDefinition Width=Auto /
    ColumnDefinition /
    /Grid.ColumnDefinitions
    TextBlock ToolTipService.ToolTip={Binding Order} x:Name=txtStimNumber Visibility=Collapsed Loaded=txtStimNumber_Loaded FontSize=14 FontWeight=Bold Margin=0,0,10,0 Grid.Column=0 /
    TextBlock Text=Stimulus FontSize=14 FontWeight=Bold Margin=0,0,10,0 Grid.Column=1 /
    StackPanel VerticalAlignment=Center Grid.Column=2
    StackPanel Orientation=Vertical
    TextBlock Text={Binding PassageRefNo, Mode=TwoWay} TextWrapping=Wrap MaxWidth=330 /
    TextBlock Text={Binding Description, Mode=TwoWay} TextWrapping=Wrap MaxWidth=330 /
    /StackPanel
    /StackPanel
    /Grid
    Grid Visibility={Binding Converter={StaticResource templateSelector}, ConverterParameter='Spec'} Margin=5
    Grid.ColumnDefinitions
    ColumnDefinition Width=Auto /
    ColumnDefinition Width=Auto /
    ColumnDefinition /
    /Grid.ColumnDefinitions
    TextBlock ToolTipService.ToolTip={Binding Order} x:Name=txtItemNumber Loaded=txtItemNumber_Loaded FontSize=14 FontWeight=Bold Margin=0,0,10,0 Grid.Column=0 /
    TextBlock Text=Idea FontSize=14 FontWeight=Bold Margin=0,0,10,0 Grid.Column=1 /
    ListBox x:Name=listMetadataSet SelectionMode=Single ItemsSource={Binding MetadataSets, Mode=TwoWay} Grid.Column=2 SelectionChanged=listMetadataSet_SelectionChanged
    ListBox.ItemTemplate
    DataTemplate
    StackPanel VerticalAlignment=Center Margin=3
    StackPanel Orientation=Horizontal
    TextBlock Text=Context : /
    TextBlock Text={Binding ContextName, Mode=TwoWay} TextWrapping=Wrap Width=150 /
    /StackPanel
    StackPanel Orientation=Horizontal
    TextBlock Text=Construct : /
    TextBlock Text={Binding ConstructName, Mode=TwoWay} TextWrapping=Wrap Width=150 /
    /StackPanel
    StackPanel Orientation=Horizontal Visibility={Binding HasDifficulty, Converter={StaticResource booleanVisibilitySelector}}
    TextBlock Text=Difficulty : /
    TextBlock Text={Binding Difficulty, Mode=TwoWay} /
    /StackPanel
    StackPanel Orientation=Horizontal Visibility={Binding HasClassification, Converter={StaticResource booleanVisibilitySelector}}
    TextBlock Text=Classification : /
    TextBlock Text={Binding Classification, Mode=TwoWay} /
    /StackPanel
    StackPanel Orientation=Horizontal Visibility={Binding IsPartOfComposite, Converter={StaticResource booleanVisibilitySelector}}
    TextBlock Text=Item Type : /
    TextBlock Text={Binding ItemType, Mode=TwoWay} /
    /StackPanel
    StackPanel Orientation=Horizontal Visibility={Binding HasYearLevel, Converter={StaticResource booleanVisibilitySelector}}
    TextBlock Text=Year Level : /
    TextBlock Text={Binding YearLevel, Mode=TwoWay} /
    /StackPanel
    StackPanel Orientation=Horizontal Visibility={Binding HasMark, Converter={StaticResource booleanVisibilitySelector}}
    TextBlock Text=Marks : /
    TextBlock Text={Binding Mark, Mode=TwoWay} /
    /StackPanel
    ItemsControl ItemsSource={Binding AdditionalMetadatas}
    ItemsControl.ItemTemplate
    DataTemplate
    StackPanel Orientation=Horizontal
    TextBlock Text={Binding Name, Mode=TwoWay} /
    TextBlock Text= : /
    TextBlock Text={Binding Value, Mode=TwoWay} /
    /StackPanel
    /DataTemplate
    /ItemsControl.ItemTemplate
    /ItemsControl
    /StackPanel
    /DataTemplate
    /ListBox.ItemTemplate
    /ListBox
    /Grid
    /StackPanel
    /common:HierarchicalDataTemplate

    Thanks in advance.

    DB:2.70:Change Listbox Selected Item Inside An Item Template From An Outside Event x9

    Thanks for your reply.
    I've implemented your 1st suggestion.
    Here is the code

    //Class wide variable
    private System.Windows.Controls.ListBox metadataSetListBox;

    //ListBox inside ItemTemplate Loded event
    private void listMetadataSet_Loaded(object sender, RoutedEventArgs e)
    {
    metadataSetListBox = (System.Windows.Controls.ListBox)sender;
    }

  • RELEVANCY SCORE 2.69

    DB:2.69:Textbox In Group Header In The Listview p3


    Hello,I am binding a listview with the observable collection and have a grouping with the textbox in the header of the group style.I need that user shuld be able to enter in the textbox and on submit ,textbox data shuld be stored in database.My question is how can I access textbox on the click of the submit button.See my xaml below:

     

    ListView Name=grd_EOM_Details ItemsSource={Binding Source={StaticResource src}} Width=Auto Height=Auto ItemContainerStyleSelector={DynamicResource myStyleSelector} Background=WhiteSmoke

     

     

    ListView.GroupStyle

     

     

    GroupStyle

     

     

    GroupStyle.ContainerStyle

     

     

    Style TargetType={x:Type GroupItem}

     

     

    Setter Property=Margin Value=0,0,0,5/

     

     

    Setter Property=Template

     

     

    Setter.Value

     

     

    ControlTemplate TargetType={x:Type GroupItem}

     

     

    Expander IsExpanded=True BorderBrush=#FFA4B97F BorderThickness=0,0,0,1

     

     

    Expander.Header

     

     

    DockPanel

     

     

    TextBlock FontWeight=Bold FontSize=13Nominee Name : /TextBlock

     

     

    TextBlock FontWeight=Bold FontSize=13 Text={Binding Path=Name} Margin=5,0,15,0 Width=60/TextBlock

     

     

    TextBlock FontWeight=Bold FontSize=13 Margin=20,0,0,0Count : /TextBlock

     

     

    TextBlock FontWeight=Bold FontSize=13 Margin=0,0,0,0 Text={Binding Path=ItemCount}/

     

     

    TextBlock FontWeight=Bold FontSize=13 Margin=400,0,0,0Enter Your Rating : /TextBlock

     

     

    TextBox Name=txtRating FontWeight=Bold FontSize=13 Margin=0,0,0,0 Width=100 HorizontalContentAlignment=Right/TextBox  ------------------- when i type txtRating. I am unable to access this textbox since its lying the expander of the group style. ????????????????????
     

     

    /DockPanel

     

     

    /Expander.Header

     

     

    Expander.Content

     

     

    ItemsPresenter /

     

     

    /Expander.Content

     

     

    /Expander

     

     

    /ControlTemplate

     

     

    /Setter.Value

     

     

    /Setter

     

     

    /Style

     

     

    /GroupStyle.ContainerStyle

     

     

    /GroupStyle

     

     

    /ListView.GroupStyle

     

     

    ListView.ViewThanks- M

    DB:2.69:Textbox In Group Header In The Listview p3

    Hi,I think the post noorbakhsh provided above can fully fulfill the task in this case. try it again and simulate the code listed in the link that noorbakhsh shared.Thanks.Jim Zhou -MSFT

  • RELEVANCY SCORE 2.69

    DB:2.69:Select Multiple Textboxes Or Multiple Textblocks At A Time For Copying s9


    hi i have requirement that user can select multiple textblocks or textboxes and coplying that values to notepad.
    like this .....
    textblock/textbox value
    textblock/textbox value
    textblock/textbox value
    textblock/textbox value
    now the user has to select textblock/textboxes and their values

    DB:2.69:Select Multiple Textboxes Or Multiple Textblocks At A Time For Copying s9

    Hi sandeepvemulas,

    i have requirement that user can select multiple textblocks or textboxes and coplying that values to notepad.

    In silverlight, it is not supported to select multi content of TextBox and TextBlock's content is not selectable.
    You are welcomed to postyour suggestion onto Silverlight Feature Suggestion Forum at
    http://dotnet.uservoice.com/forums/4325-silverlight-feature-suggestions
    As a workaround, you can manually add each TextBox/TextBlock's Text property to Clipboard and use a CheckBox for example for user to select which TextBox/TextBlock should be copied to Clipboard
    Clipboard.SetText(textBox1.Text);

    Best Regards,

  • RELEVANCY SCORE 2.69

    DB:2.69:Cant Bind To Elementname When Nesting Content In A Usercontrol zj


    Hi all,
    I have an issue with ElementName bindings - I have created a simple paging control which allows navigation through multiple content pages. This is working fine - however, I wanted to be able to have a list of the pages appear above with buttons which let
    you navigate to the pages
    I figured that I would just create a simple ItemsControl and bind it to the Items property of my custom control - this worked fine and I could navigate between pages by clicking the buttons
    Now I have a requirement to add a control which encapsulates the main navigator control on the page - if I use a ContentControl to wrap the page content everything works fine and I can still reference the element using ElementName binding. When I use a UserControl
    which directly inherits from ContentControl, the ElementName binding can no longer be resolved
    This doesn't make much sense as technically my UserControl IS a ContentControl with some extra things tacked on to it - so does anyone know why this doesn't work!?
    This is the XAML that doesn't work - notice that notes:NotesDisplay just directly inherits from ContentControl
    StackPanel x:Name=LayoutRoot Background=White
    ItemsControl ItemsSource={Binding ElementName=Nav, Path=Items}
    ItemsControl.ItemTemplate
    DataTemplate
    StackPanel
    TextBlock Text={Binding Title}/TextBlock
    TextBlock MouseEnter=TextBlock_MouseEnter Text=Click to view/TextBlock
    /StackPanel
    /DataTemplate
    /ItemsControl.ItemTemplate
    ItemsControl.ItemsPanel
    ItemsPanelTemplate
    StackPanel/StackPanel
    /ItemsPanelTemplate
    /ItemsControl.ItemsPanel
    /ItemsControl
    Border Height=100/Border
    notes:NoteDisplay
    nav:PageNavigator x:Name=Nav SelectedIndex=1
    nav:PageNavigator.Items
    nav:PageNavigatorItem Title=Page1
    nav:PageNavigatorItem.Content
    StackPanel
    TextBlockPage 1/TextBlock
    Border BorderThickness=1 BorderBrush=Gray Background=Gainsboro
    TextBlockSome Content/TextBlock
    /Border
    /StackPanel
    /nav:PageNavigatorItem.Content
    /nav:PageNavigatorItem
    nav:PageNavigatorItem Title=Page2
    nav:PageNavigatorItem.Content
    StackPanel
    TextBlockPage 2/TextBlock
    Border BorderThickness=1 BorderBrush=Gray Background=Gainsboro
    TextBlockSome Content/TextBlock
    /Border
    /StackPanel
    /nav:PageNavigatorItem.Content
    /nav:PageNavigatorItem
    /nav:PageNavigator.Items
    /nav:PageNavigator
    /notes:NoteDisplay
    /StackPanel

    This is the XAML that works...
    StackPanel x:Name=LayoutRoot Background=White
    ItemsControl ItemsSource={Binding ElementName=Nav, Path=Items}
    ItemsControl.ItemTemplate
    DataTemplate
    StackPanel
    TextBlock Text={Binding Title}/TextBlock
    TextBlock MouseEnter=TextBlock_MouseEnter Text=Click to view/TextBlock
    /StackPanel
    /DataTemplate
    /ItemsControl.ItemTemplate
    ItemsControl.ItemsPanel
    ItemsPanelTemplate
    StackPanel/StackPanel
    /ItemsPanelTemplate
    /ItemsControl.ItemsPanel
    /ItemsControl
    Border Height=100/Border
    ContentControl
    nav:PageNavigator x:Name=Nav SelectedIndex=1
    nav:PageNavigator.Items
    nav:PageNavigatorItem Title=Page1
    nav:PageNavigatorItem.Content
    StackPanel
    TextBlockPage 1/TextBlock
    Border BorderThickness=1 BorderBrush=Gray Background=Gainsboro
    TextBlockSome Content/TextBlock
    /Border
    /StackPanel
    /nav:PageNavigatorItem.Content
    /nav:PageNavigatorItem
    nav:PageNavigatorItem Title=Page2
    nav:PageNavigatorItem.Content
    StackPanel
    TextBlockPage 2/TextBlock
    Border BorderThickness=1 BorderBrush=Gray Background=Gainsboro
    TextBlockSome Content/TextBlock
    /Border
    /StackPanel
    /nav:PageNavigatorItem.Content
    /nav:PageNavigatorItem
    /nav:PageNavigator.Items
    /nav:PageNavigator
    /ContentControl
    /StackPanel
    The declaration for my UC is :

    public
    partial
    class
    NoteDisplay:ContentControl

    So as far as I'm concerned this should work...!
    I'm pulling my hair out here! Any ideas?

    Thanks,
    Charleh

    DB:2.69:Cant Bind To Elementname When Nesting Content In A Usercontrol zj

    Hi,
    How's your issue going on?
    Do you try thaicarrot's suggestion?
    So, why not just use the standard UserControl, then, you don't need to custome your own xaml.

    Regards

  • RELEVANCY SCORE 2.69

    DB:2.69:Want To Use Fixed Background Instead Of Using Any Storyboard 1c


    A single Storyboard is working fine with my Border and TextBlock code as:
    Border x:Name=border Background=Black d:LayoutOverrides=Width
    TextBlock x:Name=textBlock TextWrapping=Wrap Text=TextBlock Foreground=White Margin=10,5/
    /Border
    The Storyboard is as:
    Storyboard x:Key=OnMouseEnter1
    ColorAnimationUsingKeyFrames Storyboard.TargetProperty=(Panel.Background).(SolidColorBrush.Color) Storyboard.TargetName=border
    EasingColorKeyFrame KeyTime=0 Value=Black/
    EasingColorKeyFrame KeyTime=0:0:0.2 Value=#FF116033/
    /ColorAnimationUsingKeyFrames
    /Storyboard
    My other Border and TextBlock codes are as:
    Border x:Name=border2 Background=Black d:LayoutOverrides=Width
    TextBlock x:Name=textBlock2 TextWrapping=Wrap Text=TextBlock Foreground=White Margin=10,5/
    /Border
    Border x:Name=border1 Background=Black d:LayoutOverrides=Width
    TextBlock x:Name=textBlock1 TextWrapping=Wrap Text=TextBlock Foreground=White Margin=10,5/
    /Border
    Here for border2 and border3 my Storyboard is not working. I do not want to create multiple Storyboards to solve this as want to use only that Storyboard I have created. Could you please suggest me how it can be possible and also,
    in this types of cases can I add mouseover fixed Background instead of using any Storyboards?
    Many Thanks in advance.

    DB:2.69:Want To Use Fixed Background Instead Of Using Any Storyboard 1c

    A single Storyboard is working fine with my Border and TextBlock code as:
    Border x:Name=border Background=Black d:LayoutOverrides=Width
    TextBlock x:Name=textBlock TextWrapping=Wrap Text=TextBlock Foreground=White Margin=10,5/
    /Border
    The Storyboard is as:
    Storyboard x:Key=OnMouseEnter1
    ColorAnimationUsingKeyFrames Storyboard.TargetProperty=(Panel.Background).(SolidColorBrush.Color) Storyboard.TargetName=border
    EasingColorKeyFrame KeyTime=0 Value=Black/
    EasingColorKeyFrame KeyTime=0:0:0.2 Value=#FF116033/
    /ColorAnimationUsingKeyFrames
    /Storyboard
    My other Border and TextBlock codes are as:
    Border x:Name=border2 Background=Black d:LayoutOverrides=Width
    TextBlock x:Name=textBlock2 TextWrapping=Wrap Text=TextBlock Foreground=White Margin=10,5/
    /Border
    Border x:Name=border1 Background=Black d:LayoutOverrides=Width
    TextBlock x:Name=textBlock1 TextWrapping=Wrap Text=TextBlock Foreground=White Margin=10,5/
    /Border
    Here for border2 and border3 my Storyboard is not working. I do not want to create multiple Storyboards to solve this as want to use only that Storyboard I have created. Could you please suggest me how it can be possible and also,
    in this types of cases can I add mouseover fixed Background instead of using any Storyboards?
    Many Thanks in advance.

  • RELEVANCY SCORE 2.69

    DB:2.69:Expanding Controls To Fit Their Content zz


    Hello there
    I am unable to get the controls on my Windows Phone 8 page to stretch vertically to display their content.
    I am using textblocks and images grouped within stackpanels, within a two column grid, although I am open to suggestions.

    I have tried using textboxes rather than textblocks.
    I want the height of each row of the grid to expand appropriately to display its content, in a similar way to an HTML table.
    However, whatever I do, the vertical height of each line of my grid remains the same, and the text gets clipped, despite the fact that the height of the grid is much less than the height of the page.
    I want the two columns to continue to be the same width as each other.
    This is my basic design. I am setting the value of the textblocks in code.
    Grid.RowDefinitions
    RowDefinition Height=Auto/
    RowDefinition Height=Auto/
    ...
    RowDefinition Height=Auto/
    RowDefinition Height=*/
    /Grid.RowDefinitions
    Grid.ColumnDefinitions
    ColumnDefinition Width=1*/
    ColumnDefinition Width=1*/
    /Grid.ColumnDefinitions
    TextBlock Grid.Row=1 Grid.Column=0(Some Static Text)/TextBlock

    Border Grid.Row=1 Grid.Column=1
    StackPanel
    TextBlock Name=../TextBlock
    Image .../Image
    Image .../Image
    /StackPanel
    /Border
    Border Grid.Row=2 Grid.Column=0
    StackPanel
    TextBlock Name=../TextBlock
    Image .../Image
    /StackPanel
    /Border
    Border Grid.Row=2 Grid.Column=1
    StackPanel
    TextBlock Name=../TextBlock
    Image .../Image
    /StackPanel
    /Border

    DB:2.69:Expanding Controls To Fit Their Content zz

    That last line should read: containing a span

  • RELEVANCY SCORE 2.68

    DB:2.68:Calling Array For Mouseleftbuttondown..... m7


    Iam having my Video source files in an array(4 video files)......having 4 textblockswithsame MouseLeftButtonDown nameClick.....I want to call this array wheneach textblock been clicked....so that each textblock click shows different videofile according
    to my array........can any one solve this...........

    DB:2.68:Calling Array For Mouseleftbuttondown..... m7

    You can use the tag property of your textblock to store the array index, or better use it to store the video url instead of the array.

  • RELEVANCY SCORE 2.68

    DB:2.68:How To Align The Bottom Edge Of Multiple Textblocks With Different Fontsize 8k


    Here is the XAML sample:
    StackPanel Orientation=Horizontal
    TextBlock VerticalAlignment=Bottom Text=Text1 FontSize=20 /
    Image VerticalAlignment=Bottom ... /
    TextBlock VerticalAlignment=Bottom Text=Text2 /
    /StackPanel

    The result is that the textblocks have different bottom-margins depending on their FontSizes, but I need them all to be on one bottom line with no margins. How to get it? In my case I cant use TextBlock Runs.

    DB:2.68:How To Align The Bottom Edge Of Multiple Textblocks With Different Fontsize 8k

    TextBlocks can be nested, and they will respect the baseline.
    TextBlock VerticalAlignment=Bottom
    Run FontSize=20 Text=Text Big /
    Run Text=Text Small /
    /TextBlock

  • RELEVANCY SCORE 2.67

    DB:2.67:Not Able To Update Textblock Text If Mainpage Is Not Rootvisual 19


    I'm not able to update TextBlock text on MainPage.xamlif MainPage is not RootVisual.
    If I set this.RootVisual = new MainPage(), a TextBlock text value can be updated; however,
    if I set this.RootVisual = progressIndicator, the TextBlock text on MainPage cannot be updated by simply setting txtTextBlock.Text = some value;

    DB:2.67:Not Able To Update Textblock Text If Mainpage Is Not Rootvisual 19

    The MainPage is created in the Bootstrapper from Prism2.1
    public Bootstrapper(string tenantGuid, string ntLogon)
    {
    this.tenantGuid = tenantGuid;
    this.ntLogon = ntLogon;
    }

    protected override DependencyObject CreateShell()
    {
    mainPage = Container.ResolveMainPage();
    mainPage.TenantGuid = this.tenantGuid;
    mainPage.NtLogon = this.ntLogon;
    //Application.Current.RootVisual = mainPage;
    return mainPage;
    }

    The Bootstrapper is created in Application_Startup
    private void Application_Startup(object sender, StartupEventArgs e)
    {
    this.Resources.Add(WebContext, WebContext.Current);

    this.tenantGuid = e.InitParams[tenantGuid] as string;

    WebContext.Current.Authentication.LoadUser(this.Application_UserLoaded, null);
    this.InitializeRootVisual();
    Bootstrapper bootstrapper = new Bootstrapper(tenantGuid, e.InitParams[ntLogon] as string);
    bootstrapper.Run();
    mainPage = bootstrapper.MainPage;
    //this.RootVisual = mainPage;
    }

    private void Application_UserLoaded(LoadUserOperation operation)
    {
    if (!WebContext.Current.User.IsAuthenticated)
    {
    mainPage.LoginCompleted = new MainPage.LoginCompletedHandler(mainPage_LoginCompleted);
    mainPage.DoLogin();
    }
    else
    {
    this.progressIndicator.IsActive = false;
    }
    }

    void mainPage_LoginCompleted(LoginOperation lo)
    {
    this.progressIndicator.IsActive = false;
    mainPage.LoginCompleted -= new MainPage.LoginCompletedHandler(mainPage_LoginCompleted);
    }

    /// lt;summarygt;
    /// Initializes the lt;see cref=Application.RootVisual/gt; property. The
    /// initial UI will be displayed before the LoadUser operation has completed
    /// (The LoadUser operation will cause user to be logged automatically if
    /// using windows authentication or if the user had selected the keep
    /// me signed in option on a previous login).
    /// lt;/summarygt;
    protected virtual void InitializeRootVisual()
    {
    this.progressIndicator = new Activity();
    this.progressIndicator.Content = new MainPage();
    this.progressIndicator.IsActive = true;
    this.progressIndicator.HorizontalContentAlignment = HorizontalAlignment.Stretch;
    this.progressIndicator.VerticalContentAlignment = VerticalAlignment.Stretch;

    // Let the user know we're trying to authenticate him
    this.progressIndicator.ActiveContent = Initializing Application...;

    this.RootVisual = this.progressIndicator;
    }

  • RELEVANCY SCORE 2.67

    DB:2.67:Overlapping Controls aj


    In my application I have created a Page and having some controls on that page like List, textblock and button. I have some other controls on the same page like button and textblock. Initially button and textblock will not be visible. On some event fired
    these two controls will become visible and other controls will be disabled or faded. How can I achieve that?

    DB:2.67:Overlapping Controls aj

    Set the Visibility property on the control(s) you want to show or hide in your codebehind, example: textBlock1.Visibility = System.Windows.Visibility.Collapsed; // Not Visible textBlock1.Visibility = System.Windows.Visibility.Visible; // Visible

  • RELEVANCY SCORE 2.67

    DB:2.67:Scrollviewer Associate With Textblock Programmically.... 1p


    Hi All,
    I have a textblock thats being dynamically generated, I need to assign this textblock to be associated to a scrollviewer (also dynamically created).
    I cannot find any examples of how to programmically assign a textblock to a scrollviewer, can you help?
    Cheers
    Carl
    [::TILL THE END::]

  • RELEVANCY SCORE 2.66

    DB:2.66:Place Values Into Array 3k


    Hello,

    I am trying to make an array into which two values "globals" will be loaded in order from low to high, according to their node, with their respective value in the next column.

    Example:

    node Value
    1200
    2 500
    ..
    . .
    255 300

    What can I do to make the vi smart enough to load each node in order as it comes in with its respective value?
    -Thanx!

    DB:2.66:Place Values Into Array 3k


    You should be a bit more clear what you actually want. Do you want to sort by node or by value?

    If you want to sort by node, you only need a single 1D array containing the "Values" while the "node" can be the array index.

    Just initialize an array of length 256 (or 255 of there is no node 0), and thenreplace the array elements at index=node with the correct value in a loop (and usingshift registers).

    Please clarify!



    LabVIEW Champion . Do more with less code and in less time .

  • RELEVANCY SCORE 2.66

    DB:2.66:Bug: Adding Default Style On Application Level Has Side Effects 9a


    If I define a default style (no key) in my Application tag, controls in my window will ignore their local property values. More specifically when an element like a Label is automatically generating its internal textblock to hold the text content, the textblock does not inherit from the Label parent, instead it gets its property value from the style. The Label with context label 2 should be Red, but it's Blue from the default style. This is case does not work:
    Application x:Class=WpfApplication5.App
    xmlns=http://schemas.microsoft.com/winfx/2006/xaml/presentation
    xmlns:x=http://schemas.microsoft.com/winfx/2006/xaml
    StartupUri=Window1.xaml
    Application.Resources

    Style TargetType={x:Type Label}
    Setter Property=Foreground Value=Purple /
    /Style

    Style TargetType={x:Type TextBlock}
    Setter Property=Foreground Value=Blue /
    /Style

    /Application.Resources
    /Application

    Window x:Class=WpfApplication5.Window1
    xmlns=http://schemas.microsoft.com/winfx/2006/xaml/presentation
    xmlns:x=http://schemas.microsoft.com/winfx/2006/xaml
    Title=Window1 Height=300 Width=300 Background=Gray

    Grid

    StackPanel
    TextBlock Text=textblock 1 /
    TextBlock Foreground=Red Text=textblock 2 /

    Label Content=label 1 /
    Label Foreground=Red Content=label 2 /

    /StackPanel
    /Grid
    /Window

    But this works, because the default style is in Window, not Application
    Application x:Class=WpfApplication5.App
    xmlns=http://schemas.microsoft.com/winfx/2006/xaml/presentation
    xmlns:x=http://schemas.microsoft.com/winfx/2006/xaml
    StartupUri=Window1.xaml

    /Application

    Window x:Class=WpfApplication5.Window1
    xmlns=http://schemas.microsoft.com/winfx/2006/xaml/presentation
    xmlns:x=http://schemas.microsoft.com/winfx/2006/xaml
    Title=Window1 Height=300 Width=300 Background=Gray
    Window.Resources

    Style TargetType={x:Type Label}
    Setter Property=Foreground Value=Purple /
    /Style

    Style TargetType={x:Type TextBlock}
    Setter Property=Foreground Value=Blue /
    /Style

    /Window.Resources

    Grid

    StackPanel
    TextBlock Text=textblock 1 /
    TextBlock Foreground=Red Text=textblock 2 /

    Label Content=label 1 /
    Label Foreground=Red Content=label 2 /

    /StackPanel
    /Grid
    /Window

    DB:2.66:Bug: Adding Default Style On Application Level Has Side Effects 9a

    Hi ChromeCompass,I performed a test based on your sample code and did see the problem on my side.In your sample code, you set the Content property of the Label control to a string. In this case, the Label control creates a TextBlockto contain this string. This TextBlock exists in the visual tree of the Label but not in the logical tree. Resource lookup process traverses the logical tree upward, not the visual tree, and then applcation resources are checked. As you can see, if the style for the TextBlock control is placed in the resource dictionary of the Window, resource lookup process won't find it and apply on the TextBlock in the visual tree of the Label. On the contrary, if the style for the TextBlock is placed in the application resources, resource lookup process will find it and apply it on the TextBlock within the visual tree of the Label.For more information on resources, please read the following MSDN document:http://msdn.microsoft.com/en-us/library/ms750613.aspxHope this helps.Sincerely,Linda Liu

    Please remember to mark the replies as answers if they help and unmark them if they provide no help.Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.

  • RELEVANCY SCORE 2.66

    DB:2.66:Double Array 1x


    hi, i have a 2d array int [] [] IDAndNumber as a parameter :
    public void updateDetails(int [] [] IDAndNumber)
    {
    //code here
    }

    in the code above, i need to be able to get the persons ID from the array and their number, how can i do this?

    DB:2.66:Double Array 1x

    :-) Looks like your crystal ball needs a goodclean!
    It seems to be covered in snot!Impossible. Jos said it was working fine!:-)

  • RELEVANCY SCORE 2.66

    DB:2.66:How To Display Line By Line In Textblock 8k


    Hi, In WinMo, the string can be displayed line by line with \r\n. example : Mystring = This is a test \r\n, Hello world. Can this apply to textBlock ? It seems it wont work. Any suggestion? textBlock.text = Mystring

    DB:2.66:How To Display Line By Line In Textblock 8k

    Not sure if you resolved this yet. I needed to do something similar, pulling data from a server and displaying it in a textblock. The data on my server contains \n where I want a line break. When silverlight receives the data it stores it escapes the \n
    making it \\n. I simply used the following: today = today.Replace(\\n, \n); txtToday.Text = today;

  • RELEVANCY SCORE 2.66

    DB:2.66:Determining New Element Sizes In Sizechanged am


    I have a Windows Store app in which I need to modify the layout when orientation changes. I am doing this in the SizeChanged event, but I need to be able to determine the size of one of the elements in SizeChanged to calculate the new values I need. The
    part of my XAML that I modify need to determine the size of is:
    Grid
    StackPanel
    StackPanel
    TextBlock/
    TextBlock/
    TextBlock/
    TextBlock/
    /StackPanel
    StackPanel
    TextBlock/
    TextBlock/
    TextBlock/
    /StackPanel
    /StackPanel
    /Grid

    The attribute that I change when changing this part of thelayout is the Orientation property of the outer StackPanel, and I need to get the size of the Grid after doing that. What can I do to get this value (after it is updated, of course)? Thanks.

    Nathan Sokalski njsokalski@hotmail.com http://www.nathansokalski.com/

    DB:2.66:Determining New Element Sizes In Sizechanged am

    Thanks, the Measure/DesiredSize one gave me what I needed! So many different properties and methods that sound like they have the same information, yet only some of them do, and not until you tell them to update themselves at that. I don't know how you
    remember them all, but your answer worked!Nathan Sokalski njsokalski@hotmail.com http://www.nathansokalski.com/

  • RELEVANCY SCORE 2.66

    DB:2.66:Assigning Different Foreground To A Single Textblock c1


    Hi,
    Actually iam trying to create a custom control for which i need to add textblock which can be dynamically changed and also whose foreground can be changed depending on the selection.For eg:If the textblock contains the text Hello World then i want to change
    the foreground for word World dynamically.
    Any suggestions ...
    Thanku
    kushi

    DB:2.66:Assigning Different Foreground To A Single Textblock c1

    txt is a TextBlock
    1 txt.Inlines.Clear()
    2
    3 Dim r
    As New Run
    4 r.Text = Hello
    5
    6 Dim rWorld
    As New Run
    7 rWorld.Text = World
    8 rWorld.Foreground = New SolidColorBrush(Colors.Red)
    9
    10 txt.Inlines.Add(r)
    11 txt.Inlines.Add(rWorld)

  • RELEVANCY SCORE 2.65

    DB:2.65:Rendertransform j1


    Hi everyone :):):):)

    I have simple code

    Grid
    TextBlock Text=jkfjkdfjkg dfsghdfgdfogjdfjglfd Width=Auto Height=Auto
    TextBlock.RenderTransform
    TranslateTransform X=100 Y=100/
    /TextBlock.RenderTransform
    /TextBlock
    /Grid

    I need to put my TextBlock incoordinates100 100 but the TextBlock must be put by his Center,meaning The Center of the TextBlockmust be incoordinates(100,100) or any othercoordinate that would be given

    Can anyone tell me how to achieve it please

    Thank you in advance Anatoliy.

    DB:2.65:Rendertransform j1

    Hi Anatoliy50,
    Could you share a sample with me to understand your needs clearly?

    Best regardsSheldon _Xiao[MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

  • RELEVANCY SCORE 2.65

    DB:2.65:Textblock Bindings Getting Cleared When Changing Foreground Property? c7


    I was able to reproduce a strange occurrence with TextBlock bindings losing their meaning. The process is strange, but happens 10 out of 10 times. * Set a TextBlock Text property to some kind of binding (I use a string, the source of which is contained in the DataContext) * Set the same TextBlock's Foreground binding to another (I use a SolidColorBrush) Now, altering the Foreground backend value will work perfectly. However, if you have previously called the TextBlock's Inlines property (and enumerate through it), the next time you change the Foreground property, the Text binding will get cleared and no logner be bound! The Foreground property (among others) will continue to work.. I wonder if this is just the datacontext getting lost during the process of converting the object to a list of Runs the first time? Anyway, I created an extremely small repro program. Would be awesome if I can get some answers for why this happens: Xaml:
    Window
    x:Class=WpfTextBlockIssue.Window1
    xmlns=http://schemas.microsoft.com/winfx/2006/xaml/presentation
    xmlns:x=http://schemas.microsoft.com/winfx/2006/xaml
    Title=Window1 Height=300 Width=300
    MouseMove=Window_MouseMove
    AllowDrop=True

    StackPanel
    TextBlock Text=Data:/
    TextBlock Loaded=TextBlock_Loaded Foreground={Binding Foreground} Text={Binding Path=Test}/

    TextBlock Text=What you type below should appear above:/
    TextBox Text={Binding Path=Test, UpdateSourceTrigger=PropertyChanged}/

    Button Content=Change, no break x:Name=DontBreakMe Click=DontBreakMe_Click/
    Button Content=Breakme x:Name=BreakMe Click=BreakMe_Click/

    TextBlock Text=Mouse Under:/
    TextBlock x:Name=mouseUnder/
    /StackPanel
    /Window

    Code Behind:
    using System;
    using System.ComponentModel;
    using System.Text;
    using System.Windows;
    using System.Windows.Controls;
    using System.Windows.Input;
    using System.Windows.Media;
    using System.Windows.Documents;

    namespace WpfTextBlockIssue
    {
    /// summary
    /// Interaction logic for Window1.xaml
    /// /summary
    public partial class Window1 : Window
    {
    Data mData = new Data();

    public Window1()
    {
    this.DataContext = mData;
    InitializeComponent();
    }

    TextBlock mText = null;
    private void TextBlock_Loaded(object sender, RoutedEventArgs e)
    {
    mText = (TextBlock)sender;
    }

    private void BreakMe_Click(object sender, RoutedEventArgs e)
    {
    foreach (Inline i in mText.Inlines)
    {
    i.ToString();
    }

    Random r = new Random(DateTime.Now.Millisecond);
    mData.Foreground = new SolidColorBrush(Color.FromRgb((byte)r.Next(255), (byte)r.Next(255), (byte)r.Next(255)));
    }

    private void DontBreakMe_Click(object sender, RoutedEventArgs e)
    {
    Random r = new Random(DateTime.Now.Millisecond);
    mData.Foreground = new SolidColorBrush(Color.FromRgb((byte)r.Next(255), (byte)r.Next(255), (byte)r.Next(255)));
    }

    private void Window_MouseMove(object sender, MouseEventArgs e)
    {
    mouseUnder.Text = Mouse.DirectlyOver.ToString();
    }
    }

    #region Data Binding
    public class Data : INotifyPropertyChanged
    {
    string mTest = Test;
    public string Test
    {
    get { return mTest; }
    set
    {
    mTest = value;
    OnChange(Test);
    }
    }

    SolidColorBrush mForeground = new SolidColorBrush(Colors.Teal);
    public SolidColorBrush Foreground
    {
    get { return mForeground; }
    set
    {
    if (value != null)
    value.Freeze();

    mForeground = value;
    OnChange(Foreground);
    }
    }

    public event PropertyChangedEventHandler PropertyChanged;
    void OnChange(string name)
    {
    if (PropertyChanged != null)
    PropertyChanged(this, new PropertyChangedEventArgs(name));
    }
    }
    #endregion
    }

    DB:2.65:Textblock Bindings Getting Cleared When Changing Foreground Property? c7

    I've been away for a bit, but am surprised no one has run across this? Seems like a huge problem... and I find it really odd that the foreground property causes this behavior. Thoughts?

  • RELEVANCY SCORE 2.65

    DB:2.65:Cant Figure Out Simple Layout Issue sa


    I just can't get my head around this.
    A grid with two rows and two columns.
    Bottom row has a listbox that can take any available height left.
    Top row has a long listbox that I want to only stretch to fill available space.
    But the right side has a stack panel that i want to have the maximum height it needs to show all the elements.
    If I make the top row AUTO, it will be the height of the left listbox. I want it to be the height of the right stack panel and then show a scrollbar for the long listbox.
    I hope that is simple enough. How can I constrain the top row to the shorter stack panel (but flex with it) while the listbox stretches to fill the same height as the shorter stack panel and shows a scroll bar?
    Please have a look at or cut and paste this xaml to illustrate my problem.
    Grid HorizontalAlignment=Left Width=220 Height=130 VerticalAlignment=TopGrid.ColumnDefinitionsColumnDefinition Width=0.464*/ColumnDefinition Width=0.536*//Grid.ColumnDefinitionsGrid.RowDefinitionsRowDefinition Height=0.496*/RowDefinition Height=0.504*//Grid.RowDefinitions
    ListBoxListBoxItem Content=ListBoxItem/ListBoxItem Content=ListBoxItem/ListBoxItem Content=ListBoxItem/ListBoxItem Content=ListBoxItem/ListBoxItem Content=ListBoxItem/ListBoxItem Content=ListBoxItem/ListBoxItem Content=ListBoxItem//ListBox
    StackPanel Grid.Column=1TextBlock TextWrapping=Wrap Text=TextBlock/TextBlock TextWrapping=Wrap Text=TextBlock/TextBlock TextWrapping=Wrap Text=TextBlock/TextBlock TextWrapping=Wrap Text=TextBlock/TextBlock TextWrapping=Wrap Text=TextBlock/TextBlock TextWrapping=Wrap Text=TextBlock/TextBlock TextWrapping=Wrap Text=TextBlock//StackPanel
    ListBox Grid.Row=1 Grid.ColumnSpan=2ListBoxItem Content=ListBoxItem/ListBoxItem Content=ListBoxItem/ListBoxItem Content=ListBoxItem/ListBoxItem Content=ListBoxItem/ListBoxItem Content=ListBoxItem/ListBoxItem Content=ListBoxItem//ListBox
    /Grid

  • RELEVANCY SCORE 2.65

    DB:2.65:Scrollbar Enable.. fp


     

    Hi I have a button and textblock in my window. when ever i clicks on button Some information is going to be added in the textblock. but i am not able to scroll and see the content in the textblock. how can i enable scroll bar..Karnati.thanks

    DB:2.65:Scrollbar Enable.. fp

    I think you need to put the TextBlock in a ScrollViewer but I could be wrong. This forum is for the WPF Designer (Cider) in Visual Studio. If you have questions about WPF or using the WPF runtime then the WPF forum http://forums.msdn.microsoft.com/en-US/wpf/threads/ is probably a better place to ask your question.mark- mark(bou), Microsoft. (This post is provided as-is)

  • RELEVANCY SCORE 2.65

    DB:2.65:Mpi Collect Data From Process In Array fx



    Hi,

    I am trying to use mpi to split computations on n process on a array.

    So say process have computed the values for their ranges for eg:

    process 1: Array[1 to a1]

    process 2: Array[a1+1 to a2]

    process 3: Array[a2+1 to a3]

    process 4: Array[a3+1 to a4]

    What is the best way to send and receive data when it comes to arrays?

    Also can the same be applied it the processing of data is in contiguous memory locations? for eg:

    process1: Array[1,5,9,13 ...]

    ​process2: Array[2,6,10,14 ...]

    ​process3: Array[3,7,11,15 ...]

    ​process4: Array[4,8,12,16...]

    Thanks

    Ajay

    DB:2.65:Mpi Collect Data From Process In Array fx


    Hi Ajay,

    With the data layouts you have here, if you can keep the data for each rank contiguous, I would recommend using MPI_Scatter and MPI_Gather.  If you need the data to remain strided, the use MPI_Scatterv and MPI_Gatherv instead.

    Sincerely,

    James Tullos

    Technical Consulting Engineer

    Intel® Cluster Tools

  • RELEVANCY SCORE 2.65

    DB:2.65:Textblock With Auto Font Size kk


    Hi all,I want to create a TextBlock that will resize its font to fit its content.I have a text string: "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"When rendered in a TextBlock, it looks like this: "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa..."I want my TextBlock to render all the text without the "..." in a smaller font, like this: "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"I found some help but I can figure out a way to make it work.This tells me if the text is trimmed, but not the number of lines.
    public

    static Boolean IsTextTrimmed( this TextBlock textBlock )
    {

    Typeface typeface = new Typeface( textBlock.FontFamily,
    textBlock.FontStyle,
    textBlock.FontWeight,
    textBlock.FontStretch );

    // FormattedText is used to measure the whole width of the text held up by TextBlock container.

    FormattedText formmatedText = new FormattedText(
    textBlock.Text,

    System.Threading.

    Thread.CurrentThread.CurrentCulture,
    textBlock.FlowDirection,
    typeface,
    textBlock.FontSize,
    textBlock.Foreground );

    formmatedText.Trimming = textBlock.TextTrimming;

    return formmatedText.Width textBlock.ActualWidth;
    }

    Anyhelp would be appreciated.Freedon

    DB:2.65:Textblock With Auto Font Size kk

    Works great, this is exactly what I'm looking for!Thanks for the helpFreedon

  • RELEVANCY SCORE 2.65

    DB:2.65:Wpf - Xaml Textblock Problem 89


    I have the following in my xaml:

    Grid Grid.Column=0
    StackPanel Orientation=Horizontal Height=20 VerticalAlignment=Top
    /StackPanel
    ScrollViewer VerticalScrollBarVisibility=Auto

    StackPanel Orientation=Horizontal
    TextBlock
    Width=250
    Margin=0,0,8,0
    Name=tbDirections
    Text=
    TextWrapping=Wrap /
    TextBlock
    Width=80
    Margin=0,0,8,0
    Name=tbDistance
    Text= /
    /StackPanel
    /ScrollViewer
    /Grid
    This displays driving directions in the first TextBlock (tbDirections) and the distance in the second TextBlock (tbDistance). This works fine if the tbDirections TextBlock does not wrap. The directions displays on one line and then distance displays
    to the right of it on the same line. But if the directions wraps to 3 lines, then the next distance displays on the second line of the directions which is incorrect. Is there a way in the code behind where I can tell if wrapping has occurred? I'm
    new to WPF so this may be a dumb question.

    DB:2.65:Wpf - Xaml Textblock Problem 89

    Your question is about WPF, but you have posted in the Windows Forms form. Try posting in the
    WPF forum.

  • RELEVANCY SCORE 2.64

    DB:2.64:Put 2 Stackpanels Near Eachoter Like A Table With A Scrollview 3d


    I can get those 2 StackPanels near eachother like a table, but when i add a scrollview to it it puts the Panels under eachother, any ideas?
    Here is my code:
    Grid x:Name=ContentPanel Grid.Row=3 Margin=12,0,12,0
    Grid.ColumnDefinitions
    ColumnDefinition Width=Auto/ColumnDefinition
    ColumnDefinition Width=*/ColumnDefinition
    /Grid.ColumnDefinitions
    ScrollViewer
    StackPanel
    StackPanel Orientation=Vertical Grid.Column=0 Margin=12,0,50,0
    TextBlock Text=Test:/TextBlock TextBlock Text=Test:/TextBlock TextBlock Text=Test:/TextBlock
    /StackPanel
    StackPanel Orientation=Vertical Grid.Column=1 Margin=12,0,50,0
    TextBlock Text=Test:/TextBlock
    TextBlock Text=Test:/TextBlock
    TextBlock Text=Test:/TextBlock
    /StackPanel
    /StackPanel
    /ScrollViewer
    /Grid

    DB:2.64:Put 2 Stackpanels Near Eachoter Like A Table With A Scrollview 3d

    Yes indeed that did it, i don't need the column definitions then. Thank you.

  • RELEVANCY SCORE 2.64

    DB:2.64:How To Get All Value Of Textblock That In List Box? j1


    I had bind my data to the textblock in listbox template from sql server in xaml.
    ListBox Height=650 HorizontalAlignment=Left Margin=11,17,0,0 Name=listBox1 VerticalAlignment=Top Width=434
    ListBox.ItemTemplate
    DataTemplate
    StackPanel Orientation=Horizontal
    TextBlock Text={Binding ProId}/
    TextBlock x:Name =Price Text={Binding ProPrice}/
    /StackPanel
    /DataTemplate
    /ListBox.ItemTemplate
    /ListBox
    How can i get the value of product price since listbox data wont be fix.
    I wan to get whole product price that had bind in the listbox and calculate the total price of them. Is it possible? Or any other suggestion?

    DB:2.64:How To Get All Value Of Textblock That In List Box? j1

    Yes!!! It finally worked!!!!
    Thank you so much Jagan!!!

  • RELEVANCY SCORE 2.64

    DB:2.64:Textblock Text=Test Fontweight={Binding Boldstatus} Returns Error... c8



    TextBlock Text=Test FontWeight={Binding BoldStatus}
    /TextBlock

    The BoldStatus values will be Normal or Bold..
    this work fine if I give these values directly like ....
    TextBlock Text=Test FontWeight=Normal
    /TextBlock
    TextBlock Text=Test FontWeight=Bold
    /TextBlock

    can anyone help?..

    DB:2.64:Textblock Text=Test Fontweight={Binding Boldstatus} Returns Error... c8

    Worked both ways for me, with BoldStatus either string or FontWeight type. I'm using SL3.

  • RELEVANCY SCORE 2.64

    DB:2.64:Dynamic Adding A Item With Same Value ps


    Hi there,
    I'm writing a software that can tagging a files added to system, but as I'm beginner with WPF I have a few questions.

    This is my vision of main screen: http://img684.imageshack.us/i/11045396.png/
    Adding files (with it's tags) to database (SQLite) I just wrote, but I have problem with search form.
    - Głwne słowo kluczowe means Main key word - user must fill this form to start searching database.
    - Dodatkowe tagi means Additional tags - additional tags that is using to search files in database. Additional tags means exactly the same as SQL: SELECT * FROM tags t WHERE t.word='This is my link' OR t.word='This is my second link'
    - Left listbox shows other tags that are used in files hasing a tags listing in Additional tags
    - right listbox shows files with tags in Additional tags
    My questions are:
    1. How to dynamically
    add a tags to Additional tags groupbox after selecting tag in left listbox and filling texbox main key word? Current represent as:

    GroupBox Header=Dodatkowe tagi Margin=5,31,5,0 Name=groupBox1 Height=58 VerticalAlignment=Top
    ScrollViewer HorizontalScrollBarVisibility=Disabled VerticalScrollBarVisibility=Auto
    WrapPanel Orientation=Horizontal
    TextBlock Cursor=Hand Foreground=MidnightBlueThis is my link/TextBlock
    TextBlock Text= /
    TextBlock Cursor=Hand Foreground=MidnightBlueThis is my second link/TextBlock
    TextBlock Text= /
    TextBlock Cursor=Hand Foreground=MidnightBlueThis is my third link/TextBlock
    TextBlock Text= /
    TextBlock Cursor=Hand Foreground=MidnightBlueThis is my forth link/TextBlock
    TextBlock Text= /
    TextBlock Cursor=Hand Foreground=MidnightBlueThis is my fifth link/TextBlock
    TextBlock Text= /
    TextBlock Cursor=Hand Foreground=MidnightBlueThis is my sixth link/TextBlock
    /WrapPanel
    /ScrollViewer
    /GroupBox

    2. The tags in Additional tags must be clickable! After clicking third tag I must catch it, and clean children tags (fourth, fifth, etc). As in html: domain.ltd/?tags=first,second,third (which I can explode(',' $_GET['tags']) and
    know tags using to create new SQL command).

    DB:2.64:Dynamic Adding A Item With Same Value ps

    1. Name the WrapPanel inside the GroupBox and use WrapPanel.Children.Add() method.
    2. Use Hyperlink. Something like so:
    TextBlock
    Hyperlink/
    /TextBlock
    Or just template a Button. Or just handle TextBlock.MouseLeftButtonDown event.Bigsby, Lisboa, Portugal
    O que for, quando for, é que será o que é...
    Wenn ist das Nunstruck git und Slotermeyer? Ja! ... Beiherhund das Oder die Flipperwaldt gersput!
    http://bigsby.eu

  • RELEVANCY SCORE 2.64

    DB:2.64:How To Initialize Array[][] Via Serializedproperty? df



    Unity's serialization doesn't support a multi-dimensional array (array[][]). See: http://docs.unity3d.com/Documentation/ScriptReference/Array.html towards the bottom Note: Unity doesn't support serialization of a List of Lists, nor an Array of Arrays.


    Since the serialization doesn't support it I'd doubt that their serialization classes would support it.


    One possible workaround would be to flatten your array, instead of an array[x][y] you'd have array[x*y]

    DB:2.64:How To Initialize Array[][] Via Serializedproperty? df


    Unity's serialization doesn't support a multi-dimensional array (array[][]). See: http://docs.unity3d.com/Documentation/ScriptReference/Array.html towards the bottom Note: Unity doesn't support serialization of a List of Lists, nor an Array of Arrays.


    Since the serialization doesn't support it I'd doubt that their serialization classes would support it.


    One possible workaround would be to flatten your array, instead of an array[x][y] you'd have array[x*y]

  • RELEVANCY SCORE 2.64

    DB:2.64:Textblock: Underline On Mouseover 3s


    Hello,
    I created a style for a TextBlock control, and put it in a DictionnaryFile.xaml. I'm using Blend 3.

    First, when I wanted to edit the TextBlock's template, I was surprised to see that the option Edit Template wasn't there when you right click on the TextBlock, like for the Button, Expander... so I created the style manually in the DictionnaryFile, just
    simple stuff such as ForeGroundgand FontFamily. and it's working when I apply the style to a TextBlock. Here is my style:

    Style x:Key=TextBlockStyle TargetType=TextBlock Setter Property=FontFamily Value=Courier New/ Setter Property=Foreground Value=Blue/ /Style

    So my first question is why can't the TextBlock's model be edited using Blend option, like the other controls ?
    Now I need to have the Text of my TextBlock to be underlined when the user points on it. How can I do this please ?
    Thanks in advance.
    Sanaa

    DB:2.64:Textblock: Underline On Mouseover 3s

    Something as simple as underlining some text if the mouse is over it, should not be so difficult. Styles need to be more powerful in Silverlight; you should not have to inherit from a Label to achieve such a common task.

  • RELEVANCY SCORE 2.64

    DB:2.64:Image Array a3


    Hi I am apprentice developer for a company in the uk, I am In need of some help with some simple code and didnt know where else to turn, it would be great if anyone could help, I have pasted some code below of a working copy of my code which is an array
    of integer that are shuffled and then assigned to textblocks and two of the textblock contain the same value, effectively I want to do exactly the same as what it is doing at the moment but instead of integers I want to assign png files, please help.

    rivate void GenerateButton_Click(object sender, RoutedEventArgs e)
    {

    int[] array;
    array = new int[54];

    array = ShuffleArray(array);

    }


    int[] ShuffleArray(int[] array)
    {
    Random r = new Random();
    for (int A = array.Length; A 0; A--)
    {
    int j = r.Next(A);
    int k = array[j];
    array[j] = array[A - 1];
    array[A - 1] = k;
    }

    DisplayTextBlock.Text = array[0].ToString();
    DisplayTextBlock1.Text = array[1].ToString();
    DisplayTextBlock2.Text = array[2].ToString();
    DisplayTextBlock3.Text = array[3].ToString();
    DisplayTextBlock4.Text = array[4].ToString();
    DisplayTextBlock5.Text = array[0].ToString();
    DisplayTextBlock6.Text = array[5].ToString();
    DisplayTextBlock7.Text = array[6].ToString();
    DisplayTextBlock8.Text = array[7].ToString();
    DisplayTextBlock9.Text = array[8].ToString();
    DisplayTextBlock10.Text = array[9].ToString();
    DisplayTextBlock11.Text = array[10].ToString();
    DisplayTextBlock12.Text = array[11].ToString();
    DisplayTextBlock13.Text = array[12].ToString();
    DisplayTextBlock14.Text = array[13].ToString();

    return array;
    }

    DB:2.64:Image Array a3

    Well, do the same thing. Instead of int[], use Image[]

  • RELEVANCY SCORE 2.64

    DB:2.64:Using Javascript And Textblock 83


    Can I implement a picture in a Silverlight textblock using a javascript function. Not just a picture though, like a media player or anything out of the ordinary. If not textblock, what would be the appropriate tag to house such an element. It must be done
    through a Javascript function though. Thx in advance.

    DB:2.64:Using Javascript And Textblock 83

    Try setting the background color of the div the javascript animation is in to transparent.

  • RELEVANCY SCORE 2.64

    DB:2.64:Is This A Bug Of Silverlight? kd


    In my silverlight program, i tried to add a textblock to a canvas. Before is add it, i set its name property by

    TextBlock tb= new TextBlock ();
    tb.SetValue(TextBlock.NameProperty, controlName);
    There is no problem. Then i add it to Canvas
    canvas.Children.Add(tb);
    report an error Value doesn't fall within the expected range.
    But when i get name of this TextBlock in somewhere else, the name i assigned before can be get correctly. I am not sure what's the problem is. Now that it reports error when add it, why i can still get the property?

    DB:2.64:Is This A Bug Of Silverlight? kd

    Hi Andy,
    I tried both the examples but still could not reproduce the scenario. I still feel it is because of a unique name.
    Please replace controlname with a string and repeat the same. If it still occurs, I think we should post the scenario as a bug in Silverlight.
    Regards,
    Sakthi Sai Saranyan

  • RELEVANCY SCORE 2.64

    DB:2.64:Usercontrol Inheritance - Cant See Parent Controls sk


    As it says in subject. I've made a base control with textblock and inherited this control plus placed an additional checkbox in inherited control. I can see the checkbox but the textblock remains hidden. What could be the problem? Parent grid is under
    child grid ?
    Thanks

    DB:2.64:Usercontrol Inheritance - Cant See Parent Controls sk

    Hey,

    Thanks for reply.
    It is a usercontrol. BaseControl : UserControl and InheritedControl : BaseControl.
    Understood. Too bad it's not possible.

  • RELEVANCY SCORE 2.64

    DB:2.64:Setting The Font Of An Array Of String Controls. 3d


    I am trying to write a widget that allows text to be entered into a list in a variety of languages their associated font types (i.e. Roman, Cyrillic, Chinese etc). The code is vastly simplified if I use an array of strings to hold all the entries. The problem is that I cannot seem to be able to set the font of a string array, either to the array or its elements. Am I missing something obvious? Can anyone help?

    DB:2.64:Setting The Font Of An Array Of String Controls. 3d

    That was just what was needed, it worked a treat. Many thanks.

  • RELEVANCY SCORE 2.63

    DB:2.63:Font Size Problems 3d


    Hi
    The textblock doesnt appear to be sizing the fonts correctly, they appear smaller than size require, is there some margin added to the textblock, how can i measure the size of the text within the textblock, this is proving a pain as all the fonts in app
    are smaller than required?
    many thanks
    R

    DB:2.63:Font Size Problems 3d

    Hello, can you post some code? What is your layout? Essentially, if your TextBlock's size is too small, the text will be clipped. So make sure you give it enough size. Unfortunately you can't measure a single character's size...

  • RELEVANCY SCORE 2.63

    DB:2.63:How To Change Textblock,Textboxes, Text Etc. To Match Theme sz


    How would i use xaml to change the color of my textblock, radiobuttons etc. to match what the user has as their theme. I recently tried submitting an app but was rejected because it didn't show up when the themes changed. I want it to be easy to read on
    both a black and white screen. How would I go about doing this?

    DB:2.63:How To Change Textblock,Textboxes, Text Etc. To Match Theme sz

    I found out that it's a lot easier just to use expression blend if I want to do it for contrast.

  • RELEVANCY SCORE 2.63

    DB:2.63:Storing Image At Server In Some Folder cf


    Hi! Saad,
    I m even facin the same problem
    let me say facing it since last 4 days but dont find any solution 
    My problem is I m generating a dynamic image of canvas which has image and textblock and some other controls using writebitmap. till generating dynamic image is all right and that can be saved using OpenFileDialog
    but my real problem is image into byte array without using OpenFileDialog , so using this byte array i can save this image at some folder using WCF service at server.
    So please suggest me how to convert image into byte array without using OpenFileDialog.
    as i m doing it since last 4 days so now i m in big trouble.
     
    Thanks and regards, Usha.

    DB:2.63:Storing Image At Server In Some Folder cf

    Hi! Saad,
    I m even facin the same problem
    let me say facing it since last 4 days but dont find any solution 
    My problem is I m generating a dynamic image of canvas which has image and textblock and some other controls using writebitmap. till generating dynamic image is all right and that can be saved using OpenFileDialog
    but my real problem is image into byte array without using OpenFileDialog , so using this byte array i can save this image at some folder using WCF service at server.
    So please suggest me how to convert image into byte array without using OpenFileDialog.
    as i m doing it since last 4 days so now i m in big trouble.
     
    Thanks and regards, Usha.

  • RELEVANCY SCORE 2.63

    DB:2.63:How To Control Image Using 2d Array pf


    I have created an 8-Puzzle game in c# (an console application)
    now i want to convert it to an window 8 app i am successful in it using TextBlock control in xaml
    and its working but i want to show an image puzzle how can i use my 2d array to control images like shuffle it and move it

    DB:2.63:How To Control Image Using 2d Array pf

    Hi Pharaoh,
    Sounds like a interesting game, but not quite sure if I got what you mean, use

    Storyboarded animations should be ok.
    For instance if you wish to move an image from position A to position B,
    PointAnimation your X/Y pointposition is fine. More information plz download the
    XAML animation sample
    --James

    THE CONTENT IS PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED
    Thanks
    MSDN Community Support

    Please remember to Mark as Answer the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.

  • RELEVANCY SCORE 2.63

    DB:2.63:2 D Array To 1 D Array jc


    Hello,I have a 2 dimensional array of data (time, distance)I want to "strip" this array of data and only have the distance data going intoan array indicator.How can this be done ?

    DB:2.63:2 D Array To 1 D Array jc

    Use index array from the array palette.

    Wire one index terminal with the desired row or column and leave the other index terminal unwired. You'll get one row or one column.




    LabVIEW Champion . Do more with less code and in less time .

  • RELEVANCY SCORE 2.63

    DB:2.63:How To Put Stackpanels With Different Height Into Wrappanel Without Align In Silverlight? ps


    Hi,
    I have WrapPanel with StackPanels inside. I am creating them in C# but they align each row to biggest stackPanel height. How to avoid that alignment? this example doesn't work as I expected 4 stackPanel should be bit above!!
    Can anybody help me?

    StackPanel
    VerticalAlignment=TopTextBlock
    Text=test/TextBlock/StackPanelStackPanel
    VerticalAlignment=TopTextBlock
    Text=test/TextBlock/StackPanelStackPanel
    VerticalAlignment=TopTextBlock
    Text=test/TextBlock/StackPanelStackPanel
    VerticalAlignment=TopTextBlock
    Text=test/TextBlockTextBlock
    Text=test/TextBlock/StackPanel

    /toolkit:WrapPaneltoolkit:WrapPanel
    Margin=10,10,332,221
    Name=wrapPanel1

    DB:2.63:How To Put Stackpanels With Different Height Into Wrappanel Without Align In Silverlight? ps

    Hi fenix81,
    I am glad to hear that you have resolved your issue.
    Could you mark the replies included solution or helpful information as answer?
    And I think you could try to post your issue on an appropriate forum, then you can get better and quicker replies.
    Happy Christmas new year in advance...

    Best regards,Sheldon _Xiao [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

  • RELEVANCY SCORE 2.63

    DB:2.63:Adding Controls Dynamicly 1p


    I want to add controls to a canvas dynamically. You would think that this is a fairly easy with something like the following code
    TextBlock textblock = new TextBlock();
    .
    .
    .
    this.tagCloud.Children.Add(textblock);

    Unfortunately if I wish to add 5 of these controls, I am unable to do it with a for loop.
    foreach (var tb in tbs)
    {
    TextBlock textblock = new TextBlock();
    .
    .
    .
    this.tagCloud.Children.Add(textblock);
    }

    In the end, the canvas only shows the last item. I can resolve this issue by using the following code
    TextBlock textblock = new TextBlock();
    .
    .
    .
    this.tagCloud.Children.Add(textblock);
    TextBlock textblock1 = new TextBlock();
    .
    .
    .
    this.tagCloud.Children.Add(textblock1);
    TextBlock textblock2 = new TextBlock();
    .
    .
    .
    this.tagCloud.Children.Add(textblock2);

    If I have no idea of how many items I want to add or if I want to add 100 items, this is unfeasible. Any idea of how I can accomplish adding items with a for loop?

    DB:2.63:Adding Controls Dynamicly 1p

    Hi bouwob2,
    How is tb defined? Does tb.CanvasTop and tb.CanvasLeft have different value for each item in the for loop?
    Please add below line to the beginning and end of for loop and compare how many TextBlock added in this for loop.
    inta = this.tabCloud.Children.Count();
    ....for loop ...
    int b = this.tabCload.Children.Count();

    Best Regards,

  • RELEVANCY SCORE 2.62

    DB:2.62:Textblock Limit p1



    Can I limit/control the number of characters a user can enter into a textblock? If so, how? Im sure this can be done with code, but I believe there may be a property or something that I am overlooking. I would rather do it with some setting in the properties
    if there is one for the textblock control to help with this. Thanks

    DB:2.62:Textblock Limit p1


    A-ha!! That would be the perfect way to do this. Thank you chuck, hugs : )

  • RELEVANCY SCORE 2.62

    DB:2.62:Textblock Run Whitespace Problem 13


    I have this:
    TextBlockRun
    FontWeight=BoldNow is the time/Run for all men to come to the aid of their country./TextBlock

    The text appears without a space between 'time' and 'for': Now is the timefor all...
    How can insert the equvilent of a nbsp; ?

    DB:2.62:Textblock Run Whitespace Problem 13

    refer this thread
    http://forums.silverlight.net/forums/p/198270/461938.aspx

  • RELEVANCY SCORE 2.62

    DB:2.62:How Can I Get Text Blocks To Be The Same Size In Wpf And Silverlight? d7


    I'm trying to understand whymy text is appearing slightly larger in Silverlight 3.0. I have a UserControl that I compile and use in Silverlight and WPF. I've included the xaml, cs and output from WPF vs. Silverlight. I've tried setting textblock margin
    and padding properties to 0, but saw no difference. I'm using Visual Studio 2008 v9.0.30729.1 SP, .NET 3.5 SP1.
    Page.xaml:
    UserControl x:Class=AutoSizingTest.Page
    xmlns=http://schemas.microsoft.com/winfx/2006/xaml/presentation

    xmlns:autosize=clr-namespace:AutoSizingTest
    xmlns:x=http://schemas.microsoft.com/winfx/2006/xaml

    FontFamily=Arial
    FontSize=11

    StackPanel x:Name=MyStackPanel SizeChanged=MyStackPanel_SizeChanged
    TextBlock Text=1/
    TextBlock Text=2/
    TextBlock Text=3/
    TextBlock Text=4/
    TextBlock Text=5/
    TextBlock Text=6/
    TextBlock Text=7/
    TextBlock Text=8/
    TextBlock Text=9/
    TextBlock Text=10/
    StackPanel Orientation=Horizontal
    TextBlock Text=My Height: /
    TextBlock x:Name=ActualHeightTextBlock/
    /StackPanel
    /StackPanel
    /UserControl

    Page.xaml.cs:
    namespace AutoSizingTest
    {
    public partial class Page : UserControl
    {
    public Page()
    {
    InitializeComponent();

    }

    private void MyStackPanel_SizeChanged(object sender, SizeChangedEventArgs e)
    {
    ActualHeightTextBlock.Text = MyStackPanel.ActualHeight.ToString();
    }
    }
    }

    Output in WPF:
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    My Height: 139.15
    Output in Silverlight:
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    My Height: 143

    DB:2.62:How Can I Get Text Blocks To Be The Same Size In Wpf And Silverlight? d7

    Silverlight and WPF use different text rendering engines as well as different layout engines. Given that three pixel difference is pretty modest.

  • RELEVANCY SCORE 2.62

    DB:2.62:How To Make Run Background Color To Line Height In Textblock ax


    TextBlock Run FontSize=30 Background=Redtest/RunRun FontSize=15 Background=LightBlue BaselineAlignment=Centertest/Run/TextBlocktextblock /textblock

    I want it to be like following. How can I do it? Thanks!

    DB:2.62:How To Make Run Background Color To Line Height In Textblock ax

    They are self contained elements, which do not have a VerticalAlignment property, so you will have to colour the parent textblock property as follows:

    TextBlock Background=LightBlue VerticalAlignment=Center HorizontalAlignment=Left
    Run FontSize=30 Background=Redtest/Run
    Run FontSize=15 Background=LightBlue BaselineAlignment=Centertest/Run
    /TextBlock

    Regards,
    PedroIf you find my post helpful, please remember to Mark As Answer and/or Vote as Helpful

  • RELEVANCY SCORE 2.61

    DB:2.61:Big Help Request... pm


    I am writing a program for school (and as such I cannot write it in a way that makes sense to normal people) using a one dimensional array with 50 integers. After prompting the user for the initial value (and making it an odd number no matter what they submitted), I have filled the array with multiples of that number using the count of the counter as the multiplier.

    Ok, so everything is good up to this point in the program.

    Now, I have to print out the contents of the array BUT it must be printed in rows of 10 numbers only (ie. I cannot print out the entire table nor can I change the table to a 2 dimensional array - because, you know, that would be too easy not to mention what a normal person would do). Having banged my head against the desk for three days now, I am going to beg for help on this...

    Here is the solution that I am currently using so that I can write the rest of the program (even though I know there must be a better way to do this)...

    /* Filling the array using info provided. */

    for (int x = 0; x array.length; x++)
    array[x] = start * (x + 1);

    /* Printing the newly filled array in rows of 10. If there is a better way to do this, please let me know.*/

    System.out.print(array[0] + " " + array[1] + " " + array[2] + " " + array[3] + " " + array[4] + " ");System.out.print( + array[5] + " " + array[6] + " " + array[7] + " " + array[8] + " " + array[9]);
    System.out.print("\n" + array[10] + " " + array[11] + " " + array[12] + " " + array[13] + " " + array[14] + " ");System.out.print( + array[15] + " " + array[16] + " " + array[17] + " " + array[18] + " " + array[19]);
    System.out.print("\n" + array[20] + " " + array[21] + " " + array[22] + " " + array[23] + " " + array[24] + " ");System.out.print( + array[25] + " " + array[26] + " " + array[27] + " " + array[28] + " " + array[29]);
    System.out.print("\n" + array[30] + " " + array[31] + " " + array[32] + " " + array[33] + " " + array[34] + " ");System.out.print( + array[35] + " " + array[36] + " " + array[37] + " " + array[38] + " " + array[39]);
    System.out.print("\n" + array[40] + " " + array[41] + " " + array[42] + " " + array[43] + " " + array[44] + " ");System.out.print( + array[45] + " " + array[46] + " " + array[47] + " " + array[48] + " " + array[49]);

    Can anyone pretty please tell me how to do this more efficiently? There has to be a better way than going through and printing each element one by one like this, I simply cannot wrap my brain around it.

    Thanks for any advice you can give!
    Wulf

    DB:2.61:Big Help Request... pm

    backward, u mean array[49] .... array[0]

    public class PrintArray
    {
    public static void main(String [] args) {
    int [] array = new int[50];

    for(int n = 0; n array.length; n++) {
    array[n] = n;
    }

    for(int n = 49; n = 0; n--) {
    if(n 9){ //
    System.out.print(array[n] + " ");
    } else {
    System.out.print((array[n]*array[n])+ " ");
    }

    //print new line at element index 40,30,20,10,0
    if(n%10 == 0) {
    System.out.println();
    }
    }
    }
    }

  • RELEVANCY SCORE 2.61

    DB:2.61:Would Like To Center Textblock Text And Not Its Background Colour. 1x


     Hi,I put a TextBlock as in the first (short :-) xaml excerpt below, in a grid which has thin black lines delineating its rows and columns, making it look like an excel sheet ... The xaml for the grid is also below (it is directly twinkable i your favorite xaml editor).The problem is if i set the TextBlock VerticalAlignment=Center property, it doesnt only center the text but also the Gray background ruining the intent of having  the TextBlock BackGround colour fill the entire grid square, and also with the text completely centered both vertically and horizontally within the grid square.There might be a setting in the TextBlock control that i can use to achieve what i'd like.  Any ideas here?Othewise i'd need (i think) to use two controls - say a Rectangle for the background colour to fill the entire cell, and then a TextBlock (with the same background colour and then with VerticalAlignment=Center).  An xaml sample of this that works is below.But then again ... this adds the imho unnecessary Rectangle control where ... if there is a fast setting for TextBlock i cannot see or overlooked... this would be preferable :-)I am building a an excel looking type of page ... if there are better ways to do the below please make your voice heard :-) ...Thanks,

        TextBlock Grid.Row=2 Grid.Column=1 

                   Background=Gray

                   HorizontalAlignment=Stretch 

                   Text=Module    

                   /TextBlock 

    DB:2.61:Would Like To Center Textblock Text And Not Its Background Colour. 1x

    Hi Paul,    Noorbakhsh has a point, but to get the behavior you want with Label, you also have to set HorizontalAlignment, resulting in the background getting clipped on the sides instead of top + botton.  I took a few more minutes but here's a way to do this with Label and Styling that I believe gets your desired result (and I have tried it):

            Style TargetType=Label  

                Setter Property=Template  

                    Setter.Value 

                        ControlTemplate TargetType={x:Type Label}  

                            Grid Height={TemplateBinding Height} VerticalAlignment={TemplateBinding VerticalAlignment} Background={TemplateBinding Background}  

                                TextBlock VerticalAlignment=Center Text={TemplateBinding Content}/  

                            /Grid 

                        /ControlTemplate 

                    /Setter.Value 

                /Setter              

                Setter Property=TextBlock.TextAlignment Value=Center / 

                Setter Property=TextBlock.FontWeight Value=Bold / 

                Setter Property=TextBlock.FontSize Value=12 / 

            /Style 

  • RELEVANCY SCORE 2.61

    DB:2.61:Why The Parent Of Uielement Always Be Null? 9a


    TextBlock tb=new TextBlock();

    main.Children.Add(tb);
    This is my code, main is a Canvas UIElement,I add a textblock to it,but the textblock's parent is null.How can it be null?
    Is it a bug?Many of my code depend on this.If I mistake anything,please tell me.

    DB:2.61:Why The Parent Of Uielement Always Be Null? 9a

    @OceanCat - are you on the Release Preview build? I just tried this:
    XAML:
    Grid x:Name=rootgrid Background={StaticResource ApplicationPageBackgroundThemeBrush}
    Canvas x:Name=rootcanvas /
    /Grid
    Code:
    public MainPage()
    {
    this.InitializeComponent();
    Loaded = MainPage_Loaded;
    }

    void MainPage_Loaded(object sender, RoutedEventArgs e)
    {
    TextBlock tb = new TextBlock();
    tb.Text = test;

    rootcanvas.Children.Add(tb);

    var p = tb.Parent;
    }

    the var p shows me that indeed Canvas is the parent of the TextBlock.Tim Heuer | Program Manager, XAML | http://timheuer.com/blog |
    @timheuer

    (if my post has answered your question, please consider using the 'mark as answer' feature in the forums to help others)

  • RELEVANCY SCORE 2.61

    DB:2.61:Adding Textblock Inside Rectangle mz


    Hi friends , I want to Add Textblock inside Rectangle if I change Height ,Width , Fontsize , Fontfamily property of Textblock then Height width of rectangle also should be increased how this can be done in silverlight 2.0 either in page.xaml
    or in .cs file

    DB:2.61:Adding Textblock Inside Rectangle mz

    Hi,
    hope this helps:
    Grid x:Name=LayoutRoot
    Background=White

    Rectangle Fill=Red/Rectangle

    TextBlock Margin=10Hello
    world/TextBlock

    /Grid

    change the width and height of the grid to see it reflected inthe rectangle. In general I think you should use grids with rectanlges instead of borders because they give you much more flexibility. Looking through the template API, MS seems to do that a
    lot as well.

  • RELEVANCY SCORE 2.61

    DB:2.61:Bind Textblock To Dictionary 7p


    I have a WPF program and using Textblock as a label for a data field. But this Textblock has to contain dynamic data.
    My question is do I have to Bind this Textblock to a property and let property lookup the value of the Text or is there a way to Bind this Textblock to one method and pass the name of this Textblock as a parameter and let the method return the Text value?

    I want this Textblock to contain a default text, but allow user to double click on this Textblock and allow them to enter their own verbiage for the Text in the Textblock and I have 10 to 30 Textblocks on the screen and 7 screens like that. So it would
    be nice to have only one method instead a property for each Textblock. Or is there a better way of doing this?

    Thank You

    Peter

  • RELEVANCY SCORE 2.61

    DB:2.61:Get Line Number Of User Click From Textblock? cs


    Is it possible to get the line number when a user clicks some text in a TextBlock. I'm thinking that maybe the TextPointer Object might be of some use here.

    example-- Image user clicks line #3 of text in TextBlock, how can I get the line number C# thanks

    DB:2.61:Get Line Number Of User Click From Textblock? cs

    Hello knudmt,
    Thanksfor share your result back here.
    Regards,
    Barry
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.

    Click
    HERE to participate the survey.

  • RELEVANCY SCORE 2.60

    DB:2.60:Issues With Ienumerablet.Groupby() In Itemscontrol af


    Hello,
    I am having following scenario:
    Silverlgiht 3
    ItemsControl

    IEnumerableMyType allObjects; // MyType ima property PropertyID koeto e INT
    itemsControl.ItemsSource = allObject.GroupBy(my = my.PropertyID);

    The GroupBy is working great as I see the groups data in my items control.
    However I want to be able to get the Key property in my ItemsControl Item, so that I can format a header like this:

    TextBlock Text={Binding PropertyID, Converter={StaticResource unitConverter}} /
    I have tested all following scenarios
    TextBlock Text={Binding PropertyID, Converter={StaticResource unitConverter}} /
    TextBlock Text={Binding Key, Converter={StaticResource unitConverter}} /
    TextBlock Text={Binding Group.PropertyID, Converter={StaticResource unitConverter}} /
    TextBlock Text={Binding Group.Key, Converter={StaticResource unitConverter}} /

    and without converter also:

    TextBlock Text={Binding Path=PropertyID} /
    TextBlock Text={Binding Path=Key} /
    TextBlock Text={Binding Path=Group.PropertyID} /
    TextBlock Text={Binding Path=Group.Key} /

    As well as
    TextBlock Text={Binding Key.PropertyID, Converter={StaticResource unitConverter}} /
    TextBlock Text={Binding Key.PropertyID} /

    None of them works.
    However I have a DataGrid inside the Item of the ItemsControl, which is bound like this:

    ItemsSource={Binding}
    And it shows correct results.
    Any help will be highly appreciated :)
    To make it more wired - I never hit the Convert method of my IValueConverter.
    And to clarify - it (the Converter) is working just fine on other pages where I have the correct data.

    DB:2.60:Issues With Ienumerablet.Groupby() In Itemscontrol af

    Hello,
    I am having following scenario:
    Silverlgiht 3
    ItemsControl

    IEnumerableMyType allObjects; // MyType ima property PropertyID koeto e INT
    itemsControl.ItemsSource = allObject.GroupBy(my = my.PropertyID);

    The GroupBy is working great as I see the groups data in my items control.
    However I want to be able to get the Key property in my ItemsControl Item, so that I can format a header like this:

    TextBlock Text={Binding PropertyID, Converter={StaticResource unitConverter}} /
    I have tested all following scenarios
    TextBlock Text={Binding PropertyID, Converter={StaticResource unitConverter}} /
    TextBlock Text={Binding Key, Converter={StaticResource unitConverter}} /
    TextBlock Text={Binding Group.PropertyID, Converter={StaticResource unitConverter}} /
    TextBlock Text={Binding Group.Key, Converter={StaticResource unitConverter}} /

    and without converter also:

    TextBlock Text={Binding Path=PropertyID} /
    TextBlock Text={Binding Path=Key} /
    TextBlock Text={Binding Path=Group.PropertyID} /
    TextBlock Text={Binding Path=Group.Key} /

    As well as
    TextBlock Text={Binding Key.PropertyID, Converter={StaticResource unitConverter}} /
    TextBlock Text={Binding Key.PropertyID} /

    None of them works.
    However I have a DataGrid inside the Item of the ItemsControl, which is bound like this:

    ItemsSource={Binding}
    And it shows correct results.
    Any help will be highly appreciated :)
    To make it more wired - I never hit the Convert method of my IValueConverter.
    And to clarify - it (the Converter) is working just fine on other pages where I have the correct data.

  • RELEVANCY SCORE 2.60

    DB:2.60:Underline Blank Spaces In Textblock mc


    Hi, I have a textblock with blank spaces that I want to be underlined:

    TextBlock
    Height=21 Margin=63,105,95,0
    Name=TextBlock1 VerticalAlignment=Top
    Text=hola TextWrapping=Wrap
    TextDecorations=Underline/TextBlock
    the result is

    hola
    And I want that the result be:
    hola___________
    How Can I do it?
    thanks

    DB:2.60:Underline Blank Spaces In Textblock mc

    Hi Racsus,
    you need to differentiate between the
    encoding of special characters in XAML and the way you relate to them in code. For your text-replacement from within your code, just use
    text.Text = text.Text.Replace(' ', (char)160); .Cheers,
    Olaf
    http://blogs.intuidev.com

  • RELEVANCY SCORE 2.60

    DB:2.60:Build An Invoice In Wpf Using Code Behind 11


    To Beth Massi or interested partyies,
    I am not a developer, I am retired and use Microsofts tools mostly as a hobby because they are interesting and enjoyable to experiment with. I have a Windows 7 Professional OS, VS 2010 Expressand have just recently started using WPF, Entity
    Framework and VB together. From what I have gathered from books and web sites, such as yours, it seems that one of the goals or reasons for WPF and Entity was to make it possible to build almost any kind of a windows form. I know that there are many
    platforms such as Reports and Expression Blend that can make this possible, but can it now be done just using WPF, Entity and Visual Basic? Below is what I am attempting to do; can it be done and where can I get an explanation of the code to accomplish it?
    I have used your WpfEfMasterDetail_VB and added some more rows to your stackpanal and another ListView to build an Order Entry form. I am now interested in building an Invoice Window using a ListView for the Orders table, a second ListView for the OrderDetails
    table. To this I have added aBorder and inside theBorder created a StackPanal of TextBlocks. Using XAML I can handwrite the invoice and make it look like a typewritten report or invoice, but can it be done using VB code behind, and the two ListBoxes?
    What I would like to be able to do is click on an OrderID and have the invoice automatically written in the Border: with company name and date; customer name and address; a list of each product ordered with quantity, product name, cost each and total cost;
    and then Total Cost of the whole order at the bottom. I am using the NorthWind Database.
    I have Matthew MacDonalds book, Pro WPF in VB 2010, and he expertly explains several methods and approaches to many things, but I am not knowledgeable and experienced enough with WPF to pick and chose the various elements needed to accomplish
    my task, can you help by directing me to the right information?
    Bob
    The following code shows my first successful attempt (Jan. 11, 2011)
    Private Sub btnSample_Click(ByVal sender As System.Object, ByVal e As System.Windows.RoutedEventArgs) Handles btnSample.Click

    'Create TextBlocks for StackPanal spInvoice

    Dim TextBlock48 = New TextBlock()

    TextBlock48.VerticalAlignment = Windows.VerticalAlignment.Top

    TextBlock48.HorizontalAlignment = Windows.HorizontalAlignment.Center

    TextBlock48.Text = NorthWind Food Specialists

    Dim TextBlock49 = New TextBlock()

    TextBlock49.Margin = New Thickness(0, 0, 0, 15)

    TextBlock49.VerticalAlignment = Windows.VerticalAlignment.Top

    TextBlock49.HorizontalAlignment = Windows.HorizontalAlignment.Center

    TextBlock49.Text = Today

    'Purchase order number

    Dim strOID As String =

    strOID = TextBox1.Text

    'Entity join query to get each item in the Order_Details table

    Dim detailShow = From qi In db.Order_Details

    Join pro In db.Products On qi.ProductID Equals pro.ProductID

    Where qi.OrderID = strOID

    Select qi.OrderID, qi.ProductID, pro.ProductName, qi.Quantity, qi.UnitPrice

    Me.DataGrid1.ItemsSource = detailShow

    Dim quan = From q In detailShow

    Select q.Quantity

    ' Creates and initializes a new Queue to store in an array or Queue the Quan.

    Dim lops As Integer = 0

    Dim lop2 As Integer = 1

    Dim myQ As New Queue()

    For Each q In quan

    myQ.Enqueue(q) 'Adds each item quanity to an array or Queue

    lops = lops 1

    Next

    Dim name = From n In detailShow

    Select n.ProductName

    ' Creates and initializes a new Queue to store in an array or Queue the Name of the Product.

    lops = 0

    lop2 = 1

    Dim myQ2 As New Queue()

    For Each n In name

    myQ2.Enqueue(n) 'Adds each item name to an array or Queue

    lops = lops 1

    Next

    Dim cost = From c In detailShow

    Select c.UnitPrice

    ' Creates and initializes a new Queue to store in an array or Queue the Cost of the Product.

    lops = 0

    lop2 = 1

    Dim myQ3 As New Queue()

    For Each c In cost

    myQ3.Enqueue(c) 'Adds each item cost to an array or Queue

    lops = lops 1

    Next

    'Stores the array elements into variables

    Dim strNam As String = Hello

    Dim intQuan As Integer = 1

    Dim sngCost As Single = 1.1

    Dim TotalCost As Single = 1.1

    Dim TotalCost2 As Single = 0

    Dim txtBlock As String = Put together

    Dim TextBox11 = New TextBox()

    TextBox11.Width = 0

    TextBox11.Height = 0

    'Unites the variables into a textblock

    For i = 1 To lops

    intQuan = myQ.Dequeue

    strNam = myQ2.Dequeue

    sngCost = myQ3.Dequeue

    TotalCost = intQuan * sngCost

    TextBox11.Text = TotalCost

    TextBox11.Text = Format(TotalCost, $###0.00)

    TotalCost2 = TotalCost

    txtBlock = strNam intQuan ea @ sngCost = TextBox11.Text

    Select Case i

    Case 1

    txtBlock1 = txtBlock

    Case 2

    txtBlock2 = txtBlock

    Case 3

    txtBlock3 = txtBlock

    Case 4

    txtBlock4 = txtBlock

    Case 5

    txtBlock5 = txtBlock

    Case 6

    txtBlock6 = txtBlock

    Case 7

    txtBlock7 = txtBlock

    End Select

    Next

    Dim TextBox10 = New TextBox()

    TextBox10.Width = 0

    TextBox10.Height = 0

    TextBox10.Text = Format(TotalCost2, $###0.00)

    txtBlock50 = Total cost of all items= TextBox10.Text

    Dim TextBlock50 = New TextBlock()

    TextBlock50.Margin = New Thickness(0, 0, 0, 10)

    TextBlock50.VerticalAlignment = Windows.VerticalAlignment.Top

    TextBlock50.HorizontalAlignment = Windows.HorizontalAlignment.Center

    TextBlock50.Text = txtBlock50

    Dim TextBlock51 = New TextBlock()

    TextBlock51.Text = txtBlock1

    Dim TextBlock52 = New TextBlock()

    TextBlock52.Text = txtBlock2

    Dim TextBlock53 = New TextBlock()

    TextBlock53.Text = txtBlock3

    Dim TextBlock54 = New TextBlock()

    TextBlock54.Text = txtBlock4

    Dim TextBlock55 = New TextBlock()

    TextBlock55.Text = txtBlock5

    Dim TextBlock56 = New TextBlock()

    TextBlock56.Text = txtBlock6

    Dim TextBlock57 = New TextBlock()

    TextBlock57.Text = txtBlock7

    'Place the TextBlocks in spInvoice

    Dim container As IAddChild = spInvoice

    container.AddChild(TextBlock48)

    container.AddChild(TextBlock49)

    container.AddChild(TextBlock50)

    container.AddChild(TextBlock51)

    container.AddChild(TextBlock52)

    container.AddChild(TextBlock53)

    container.AddChild(TextBlock54)

    container.AddChild(TextBlock55)

    container.AddChild(TextBlock56)

    container.AddChild(TextBlock57)

    End Sub

    Here's an updated version (5/14/2011), rearranging the page format and placing the total cost of the invoiceat the bottom of the list instead of the top.
    Bob
    Private Sub btnWriteInvoice_Click(ByVal sender As System.Object, ByVal e As System.Windows.RoutedEventArgs) Handles btnWriteInvoice.Click
    'Me.spInvoice.ClearValue() 'how can I start over every time through?
    'Create TextBlocks for StackPanal spInvoice
    Dim TextBlock48 = New TextBlock()
    TextBlock48.VerticalAlignment = Windows.VerticalAlignment.Top
    TextBlock48.HorizontalAlignment = Windows.HorizontalAlignment.Center
    TextBlock48.Text = NorthWind Food Specialists

    Dim TextBlock49 = New TextBlock()
    TextBlock49.Margin = New Thickness(0, 0, 0, 15)
    TextBlock49.VerticalAlignment = Windows.VerticalAlignment.Top
    TextBlock49.HorizontalAlignment = Windows.HorizontalAlignment.Center
    TextBlock49.Text = Today

    'Get Purchase order number
    Dim strOID As String =
    strOID = TextBox1.Text
    'strOID = DataGrid2.Items.CurrentItem.ToString() 'gets the whole first row, always
    'strRow = DataGrid2.Items.GetItemAt(strOID).ToString 'gets the row of the number that I put in TextBox1
    'strRow = DataGrid2.Items.CurrentPosition.ToString() 'always gets 0
    'strIndexNum = DataGrid2.CurrentItem.ToString() 'throws an exception

    'Entity join query to get each item in the Order_Details table
    Dim detailShow = From qi In db.Order_Details
    Join pro In db.Products On qi.ProductID Equals pro.ProductID
    Where qi.OrderID = strOID
    Select qi.OrderID, qi.ProductID, pro.ProductName, qi.Quantity, qi.UnitPrice

    Me.DataGrid1.ItemsSource = detailShow

    Dim quan = From q In detailShow
    Select q.Quantity

    ' Creates and initializes a new Queue to store in an array or Queue the Quan.
    Dim lops As Integer = 0
    Dim lop2 As Integer = 1
    Dim myQ As New Queue()
    For Each q In quan
    myQ.Enqueue(q) 'Adds each item quanity to an array or Queue
    lops = lops 1
    Next

    Dim name = From n In detailShow
    Select n.ProductName

    ' Creates and initializes a new Queue to store in an array or Queue the Name of the Product.
    lops = 0
    lop2 = 1
    Dim myQ2 As New Queue()
    For Each n In name
    myQ2.Enqueue(n) 'Adds each item name to an array or Queue
    lops = lops 1
    Next

    Dim cost = From c In detailShow
    Select c.UnitPrice

    ' Creates and initializes a new Queue to store in an array or Queue the Cost of the Product.
    lops = 0
    lop2 = 1
    Dim myQ3 As New Queue()
    For Each c In cost
    myQ3.Enqueue(c) 'Adds each item cost to an array or Queue
    lops = lops 1
    Next

    'Stores the array elements into variables
    Dim strNam As String = Hello
    Dim intQuan As Integer = 1
    Dim sngCost As Single = 1.1
    Dim TotalCost As Single = 1.1
    Dim TotalCost2 As Single = 0
    Dim txtBlock As String = Put together

    Dim TextBox11 = New TextBox()
    TextBox11.Width = 0
    TextBox11.Height = 0

    Dim cusName As String = TextBox2.Text
    Dim TextBox10 = New TextBox()
    TextBox10.Width = 0
    TextBox10.Height = 0

    Dim TextBlock50 = New TextBlock()
    TextBlock50.Margin = New Thickness(0, 0, 40, 0)
    TextBlock50.VerticalAlignment = Windows.VerticalAlignment.Top
    TextBlock50.HorizontalAlignment = Windows.HorizontalAlignment.Right

    Dim TextBlock51 = New TextBlock()
    TextBlock51.Margin = New Thickness(0, 0, 40, 0)
    TextBlock51.HorizontalAlignment = Windows.HorizontalAlignment.Right

    Dim TextBlock52 = New TextBlock()
    TextBlock52.Margin = New Thickness(0, 0, 40, 0)
    TextBlock52.HorizontalAlignment = Windows.HorizontalAlignment.Right

    Dim TextBlock53 = New TextBlock()
    TextBlock53.Margin = New Thickness(0, 0, 40, 0)
    TextBlock53.HorizontalAlignment = Windows.HorizontalAlignment.Right

    Dim TextBlock54 = New TextBlock()
    TextBlock54.Margin = New Thickness(0, 0, 40, 0)
    TextBlock54.HorizontalAlignment = Windows.HorizontalAlignment.Right

    Dim TextBlock55 = New TextBlock()
    TextBlock55.Margin = New Thickness(0, 0, 40, 0)
    TextBlock55.HorizontalAlignment = Windows.HorizontalAlignment.Right

    Dim TextBlock56 = New TextBlock()
    TextBlock56.Margin = New Thickness(0, 0, 40, 0)
    TextBlock56.HorizontalAlignment = Windows.HorizontalAlignment.Right

    Dim TextBlock57 = New TextBlock()
    TextBlock57.Margin = New Thickness(0, 0, 40, 0)
    TextBlock57.HorizontalAlignment = Windows.HorizontalAlignment.Right

    'Unites the variables into a textblock
    For i = 1 To lops
    intQuan = myQ.Dequeue
    strNam = myQ2.Dequeue
    sngCost = myQ3.Dequeue
    TotalCost = intQuan * sngCost
    TextBox11.Text = TotalCost
    TextBox11.Text = Format(TotalCost, $###0.00)
    TotalCost2 = TotalCost
    txtBlock = strNam intQuan ea @ sngCost = TextBox11.Text

    Select Case i
    Case 1
    TextBlock50.Text = txtBlock
    Case 2
    TextBlock51.Text = txtBlock
    Case 3
    TextBlock52.Text = txtBlock
    Case 4
    TextBlock53.Text = txtBlock
    Case 5
    TextBlock54.Text = txtBlock
    Case 6
    TextBlock55.Text = txtBlock
    Case 7
    TextBlock56.Text = txtBlock
    End Select
    Next

    TextBox10.Text = Format(TotalCost2, $###0.00)
    txtBlock50 = Total cost of all items for our customer, cusName = TextBox10.Text

    If lops = 1 Then
    TextBlock51.Text = txtBlock50
    End If

    If lops = 2 Then
    TextBlock52.Text = txtBlock50
    End If

    If lops = 3 Then
    TextBlock53.Text = txtBlock50
    End If

    If lops = 4 Then
    TextBlock54.Text = txtBlock50
    End If

    If lops = 5 Then
    TextBlock55.Text = txtBlock50
    End If

    If lops = 6 Then
    TextBlock56.Text = txtBlock50
    End If

    If lops 7 Then
    TextBlock57.Text = txtBlock50
    End If

    'Place the TextBlocks in spInvoice
    Dim container As IAddChild = spInvoice
    container.AddChild(TextBlock48)
    container.AddChild(TextBlock49)
    container.AddChild(TextBlock50)
    container.AddChild(TextBlock51)
    container.AddChild(TextBlock52)
    container.AddChild(TextBlock53)
    container.AddChild(TextBlock54)
    container.AddChild(TextBlock55)
    container.AddChild(TextBlock56)
    container.AddChild(TextBlock57)
    End Sub

    DB:2.60:Build An Invoice In Wpf Using Code Behind 11

    I have found a way to do an invoice using code behind as I requested and then illustratedabove, so you can mark this as answered.
    BobRobert Agans

  • RELEVANCY SCORE 2.60

    DB:2.60:Adding Textblock In Interactive3d:Trackballdecorator - Viewport 3d 7j


    how to add a textblock to interactive3D:TrackballDecorator - viewport 3d so that the text can be rotated with the 3d object imported in wpf. Right now blend 2 is not allowing me to add textblock to interactive3D:TrackballDecorator. If their is any other way to do this please let me know. Also i need to add pan functionality in my viewport 3d as i already added zoom and rotate functionality using mouse. Thanks

    DB:2.60:Adding Textblock In Interactive3d:Trackballdecorator - Viewport 3d 7j

    Second, you can use PlanarTextureCoordinateGenerator, SphericalTextureCoordinateGenerator or CylindricalTextureCoordinateGenerator to make text be rotate with a 3D object directly. For example: XAML
    Window x:Class=demo.Window1
    xmlns=http://schemas.microsoft.com/winfx/2006/xaml/presentation
    xmlns:x=http://schemas.microsoft.com/winfx/2006/xaml
    xmlns:local=clr-namespace:_3DTools;assembly=3DTools
    xmlns:mc=http://schemas.openxmlformats.org/markup-compatibility/2006
    xmlns:d=http://schemas.microsoft.com/expression/blend/2006
    mc:Ignorable=d
    Title=Window1 Width=600 Height=480
    Window.Resources
    Button x:Key=updown Content=updown /
    local:PlanarTextureCoordinateGenerator x:Key=planeGen /local:PlanarTextureCoordinateGenerator
    Transform3DGroup x:Key=CubeTransform
    RotateTransform3D d:EulerAngles=0,0,0
    RotateTransform3D.Rotation
    AxisAngleRotation3D Angle={Binding ElementName=slider,Path=Value, Mode=TwoWay} Axis=1,0,0/
    /RotateTransform3D.Rotation
    /RotateTransform3D
    /Transform3DGroup
    MeshGeometry3D x:Key=CubeTop
    TriangleIndices=0,1,2 2,3,0
    Normals=0,1,0 0,1,0 0,1,0 0,1,0
    Positions=0.5,0.5,-0.5 -0.5,0.5,-0.5 -0.5,0.5,0.5 0.5,0.5,0.5
    TextureCoordinates={Binding RelativeSource={RelativeSource Self}, Converter={StaticResource planeGen}, ConverterParameter='0 1 0'}
    /
    MeshGeometry3D x:Key=CubeFront
    TriangleIndices=0,1,2 2,3,0
    Normals=0,0,1 0,0,1 0,0,1 0,0,1
    Positions=-0.5,-0.5,0.5 0.5,-0.5,0.5 0.5,0.5,0.5 -0.5,0.5,0.5
    TextureCoordinates={Binding RelativeSource={RelativeSource Self}, Converter={StaticResource planeGen}, ConverterParameter='0 0 1'}
    /
    MeshGeometry3D x:Key=CubeBottom
    TriangleIndices=0,1,2 2,3,0
    Normals=0,-1,0 0,-1,0 0,-1,0 0,-1,0
    Positions=-0.5,-0.5,-0.5 0.5,-0.5,-0.5 0.5,-0.5,0.5 -0.5,-0.5,0.5
    TextureCoordinates={Binding RelativeSource={RelativeSource Self}, Converter={StaticResource planeGen}, ConverterParameter='0 -1 0'}
    /
    MeshGeometry3D x:Key=CubeBack
    TriangleIndices=0,1,2 2,3,0
    Normals=0,0,-1 0,0,-1 0,0,-1 0,0,-1
    Positions=-0.5,-0.5,-0.5 -0.5,0.5,-0.5 0.5,0.5,-0.5 0.5,-0.5,-0.5
    TextureCoordinates={Binding RelativeSource={RelativeSource Self}, Converter={StaticResource planeGen}, ConverterParameter='0 0 -1'}
    /
    /Window.Resources
    StackPanel x:Name=LayoutRoot
    local:Interactive3DDecorator
    Viewport3D x:Name=viewp Margin=8,34,8,8 ClipToBounds=True IsEnabled=True SnapsToDevicePixels=False Height=350
    Viewport3D.Camera
    PerspectiveCamera x:Name=Camera FieldOfView=45 FarPlaneDistance=100 LookDirection=0,0,-1 NearPlaneDistance=0.1 Position=0,0,4 UpDirection=0,1,0/
    /Viewport3D.Camera
    ModelVisual3D x:Name=light
    ModelVisual3D.Content
    PointLight ConstantAttenuation=2 LinearAttenuation=0 Position=0,0,8 QuadraticAttenuation=0 Range=10
    PointLight.Transform
    Transform3DGroup
    TranslateTransform3D OffsetX=0 OffsetY=0 OffsetZ=0/
    ScaleTransform3D ScaleX=1 ScaleY=1 ScaleZ=1/
    RotateTransform3D d:EulerAngles=0,0,0/
    TranslateTransform3D OffsetX=0 OffsetY=0 OffsetZ=0/
    TranslateTransform3D OffsetX=-0.258 OffsetY=-0.024 OffsetZ=0/
    /Transform3DGroup
    /PointLight.Transform
    /PointLight
    /ModelVisual3D.Content
    /ModelVisual3D
    local:InteractiveVisual3D Geometry={DynamicResource CubeFront} x:Name=front IsBackVisible=True Transform={StaticResource CubeTransform}
    local:InteractiveVisual3D.Visual
    StackPanel Width=Auto Height=100 Background=#FFFF0000 Orientation=Horizontal
    Button Width=64 Height=64 Content=Button Margin=5,0,5,0/
    /StackPanel
    /local:InteractiveVisual3D.Visual
    /local:InteractiveVisual3D
    local:InteractiveVisual3D Geometry={DynamicResource CubeBottom} x:Name=unten IsBackVisible=True Transform={StaticResource CubeTransform}
    local:InteractiveVisual3D.Visual
    StackPanel Width=Auto Height=100 Background=#FFFF00FF Orientation=Horizontal
    Button Width=64 Height=64 Content=Button Margin=5,0,5,0/
    /StackPanel
    /local:InteractiveVisual3D.Visual
    /local:InteractiveVisual3D
    local:InteractiveVisual3D Geometry={DynamicResource CubeBack} x:Name=hinten IsBackVisible=True Transform={StaticResource CubeTransform}
    local:InteractiveVisual3D.Visual
    StackPanel Width=Auto Height=100 Background=#FFFFFF22 Orientation=Horizontal
    Button Margin=5,0,5,0 Width=64 Height=64 Content=Button BorderThickness=1,1,1,1/
    Button Width=64 Height=64 Content=Button Margin=5,0,5,0/
    Button Width=64 Height=64 Content=Button Margin=5,0,5,0/
    /StackPanel
    /local:InteractiveVisual3D.Visual
    /local:InteractiveVisual3D
    local:InteractiveVisual3D Geometry={DynamicResource CubeTop} x:Name=oben IsBackVisible=True Transform={StaticResource CubeTransform}
    local:InteractiveVisual3D.Visual
    StackPanel Width=Auto Height=100 Background=#FF00FF22 Orientation=Horizontal
    Button Width=64 Height=64 Content=Button Margin=5,0,5,0/
    Button Width=64 Height=64 Content=Button Margin=5,0,5,0/
    Button Width=64 Height=64 Content=Button Margin=5,0,5,0/
    /StackPanel
    /local:InteractiveVisual3D.Visual
    /local:InteractiveVisual3D
    /Viewport3D
    /local:Interactive3DDecorator
    Slider Width=424 Height=32 x:Name=slider Maximum=360 Margin=0,42,0,0/
    /StackPanel
    /Window

  • RELEVANCY SCORE 2.60

    DB:2.60:How To Get Inlineuicontainer In Uielement In Richtextbox m9


    Hi,
    I have a inlineUIContainer containing a TextBlock in RichTextBox. The code is,
    TextBlock tagBlock = new TextBlock

    {
    Background = brush,
    Padding = new Thickness(3, 2, 3, 2),
    Margin = new Thickness(0, 0, 0, -4),
    FontFamily = fontFamily,
    FontSize = fontSize,
    Cursor = Cursors.Hand,
    Text = content,
    Tag = key,
    ToolTip = windowType
    };

    tagBlock.MouseDown = new MouseButtonEventHandler(TagUIContainer_MouseDown);

    InlineUIContainer tagContainer = new InlineUIContainer(tagBlock, size);
    My question is how to get handle of inlineUIContainer from TextBlock (UIElement). Since clicking the inlineUIContainer, it will direct to event handler

    TagUIContainer_MouseDown, whose code is
    public void TagUIContainer_MouseDown(object sender, MouseButtonEventArgs e)
    {
    if (e.ClickCount = 2)
    {
    TextBlock textBlock = (TextBlock)sender;
    }
    }

    I need to know to how to get inlineUIContainer from TextBlock (UIElement) because inlineUIContainer can not be casted from sender. Thanks.

    York

    York

    DB:2.60:How To Get Inlineuicontainer In Uielement In Richtextbox m9

    Hi,
    I have a inlineUIContainer containing a TextBlock in RichTextBox. The code is,
    TextBlock tagBlock = new TextBlock

    {
    Background = brush,
    Padding = new Thickness(3, 2, 3, 2),
    Margin = new Thickness(0, 0, 0, -4),
    FontFamily = fontFamily,
    FontSize = fontSize,
    Cursor = Cursors.Hand,
    Text = content,
    Tag = key,
    ToolTip = windowType
    };

    tagBlock.MouseDown = new MouseButtonEventHandler(TagUIContainer_MouseDown);

    InlineUIContainer tagContainer = new InlineUIContainer(tagBlock, size);
    My question is how to get handle of inlineUIContainer from TextBlock (UIElement). Since clicking the inlineUIContainer, it will direct to event handler

    TagUIContainer_MouseDown, whose code is
    public void TagUIContainer_MouseDown(object sender, MouseButtonEventArgs e)
    {
    if (e.ClickCount = 2)
    {
    TextBlock textBlock = (TextBlock)sender;
    }
    }

    I need to know to how to get inlineUIContainer from TextBlock (UIElement) because inlineUIContainer can not be casted from sender. Thanks.

    York

    York