Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8441511
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T08:34:45+00:00 2026-06-10T08:34:45+00:00

I’m trying to use binding with C# and a XAML SemanticZoom control in my

  • 0

I’m trying to use binding with C# and a XAML SemanticZoom control in my Metro app, but honestly I’m at a loss as to how to do it. Here’s the XAML code I’ve gotten so far by piecing together from questions, articles, etc:

<SemanticZoom x:Name="boardZoom" Height="626" Margin="10,132,10,0" VerticalAlignment="Top">
        <SemanticZoom.ZoomedInView>

           <GridView IsSwipeEnabled="True" x:Name="ItemsGridView">

                    <GridView.ItemTemplate>

                        <DataTemplate>
                            <StackPanel Orientation="Horizontal" Margin="10,10,0,0" 
                        HorizontalAlignment="Left" Background="White">
                                <TextBlock Text="{Binding Title}" TextWrapping="Wrap" Width="200" Height="300"
                                    FontFamily="Global User Interface" FontSize="40" Foreground="Black"
                           VerticalAlignment="Center"  HorizontalAlignment="Left"/>

                                <Image Source="{Binding Image}" Height="60" Width="60" 
                       VerticalAlignment="Center" Margin="0,0,10,0" Visibility="{Binding isImage}" />

                                <TextBlock Text="{Binding Category}" TextWrapping="Wrap" Width="200"
                                    FontFamily="Global User Interface" Foreground="Black"
                           VerticalAlignment="Center"  HorizontalAlignment="Left"/>
                            </StackPanel>
                        </DataTemplate>

                    </GridView.ItemTemplate>

                </GridView>
            </SemanticZoom.ZoomedInView>

<!--Didn't include SemanticZoom.ZoomedOutView since I'm still trying to get the ZoomedIn one working first-->

        </SemanticZoom>

And my C# code:

        List<PinStore.pin> pins = PinStore.CopyFromStream(response.GetResponseStream()); //returns a list of PinStore.pin objects, which have name, type, Image, isImage, and Category objects
        System.Collections.ObjectModel.ObservableCollection<SemanticZoomed.zoomedIn> toSource = new System.Collections.ObjectModel.ObservableCollection<SemanticZoomed.zoomedIn>(); //should I be using ObservableCollection or something like List<> here?
        foreach (PinStore.pin pin in pins)
        {
            SemanticZoomed.ZoomedIn toAdd = new SemanticZoomed.ZoomedIn(); //class with Title, Image, isImage, and Category objects
            if (pin.type == "text")
            {
                toAdd.Title = pin.name;
                toAdd.Image = null;
                toAdd.isImage = Visibility.Collapsed;
                toAdd.Category = pin.category;
            }
            toSource.Add(toAdd);
        }
        ItemsGridView.DataContext = toSource;

I’ve not had much experience in XAML/C#, and zero experience with binding. I’m not getting any errors, but I’ve noticed that if I replace ItemsGridView.DataContext = toSource; with ItemsGridView.ItemsSource = toSource; a blank stackpanel shows up in the GridView, and I can’t seem to find a way to fill that with the Title and Category values I specify. Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T08:34:46+00:00Added an answer on June 10, 2026 at 8:34 am

    Well you should first consider creating a ResourceDictionary so you can save your item style. Then you can set the ItemStyle to the Resource Dictionary.

    But regardless you need to do: ItemsGridView.ItemsSource = toSource; If you do not choose to Bind the toSource in the GridView xaml.

    Also make sure the SemanticZoomed.zoomedIn object implements the INotifyPropertyChanged interface, And calls the event properly. And make sure the Title, Image, Category, etc are public properties that call the event when edited. and Also you need make sure pin.Text is an actual value. {Making sure}.

    If you want to learn more about data binding check out how they do it in C# & XAML with Windows 8 {Should be the same thing}:
    http://msdn.microsoft.com/en-us/library/windows/apps/xaml/hh464965.aspx

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to understand how to use SyndicationItem to display feed which is
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I'm trying to use string.replace('’','') to replace the dreaded weird single-quote character: ’ (aka
Basically, what I'm trying to create is a page of div tags, each has
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I want to count how many characters a certain string has in PHP, but
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I am trying to render a haml file in a javascript response like so:
I have this code to decode numeric html entities to the UTF8 equivalent character.
I have a French site that I want to parse, but am running into

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.