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

  • SEARCH
  • Home
  • 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 976747
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T03:47:47+00:00 2026-05-16T03:47:47+00:00

I have a view with some controls and a viewbox. At the moment in

  • 0

I have a view with some controls and a viewbox. At the moment in the viewbox is a grid and a graphic at the bottom. The application reads a XML-file and refreshs the content of the grid and the graphic for every node in the XML-file.

Now the application not only have to show a grid with a graphic. Depending on the XML-node, the application should show a grid with a graphic like now or a grahpic and at the bottom 2 lines of text.

  • 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-05-16T03:47:47+00:00Added an answer on May 16, 2026 at 3:47 am

    You explained what your application is, but you didn’t ask a question. Please state the question, and I can try to give you a better answer.

    My best guess is “how do I do that? Do I need to write a custom control?” If that is what you are asking, you probably don’t.

    Usually you don’t need a custom control to make a specialized view for a listbox, listview, or gridview. You can often use data templates, control templates or styles to achieve what you are looking for.

    I am not sure if this is a good resource, but the XAML looks like it may be a good starting point for learning how to do control templates:
    http://ligao101.wordpress.com/2007/07/27/customizing-listview-in-wpf-part-i/

    Simply googling for any of those terms (“ListView data template”, etc) will probably get you some good information.

    Edit:

    From the comments, you are trying to support one of two types of data in the same space in the UI, depending on what is in your XML file:

    • Image Only
    • Image, plus two lines of text

    One way to solve this would be to create a view model for your XML items, and bind the items to those view models:

    public class XmlItemViewModel // Call this something more appropriate to your app
    {
        public Visibility TextVisibility { get; set; }
        public string Text1 { get; set; }
        public string Text2 { get; set; }
        public Image Picture { get; set; }
    }
    

    If you already have a different class that has this data, keep it, and make the view model read properties off that class.

    Bind the XAML TextBlock Visibility property to “{Binding TextVisibility}”, and it should work. If you set the viewmodel property “Visibility.Collapsed”, the text blocks will go away, and your ViewBox should shrink to fit only the image.

    If you do this, you don’t need a custom control, just a custom ViewModel class.

    If it doesn’t seem to collapse correctly, you could wrap your image and text blocks with a StackPanel or WrapPanel.

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

Sidebar

Related Questions

In my xib file I have some View. And I have PainView class (UIView).
I have a view control and inside I plan to place some controls like
I have a view that a content some NSTextfields and NSComboboxes. I want to
I'm working on a grid view that will display cells that will have some
I have a scroll view which has some controls like textField and textArea on
I have a FrameLayout view which contains one (MapView-like) control and some additional buttons
I have a View where some input text to be added dynamica using jquery,
I have a partial view with some JQuery... $(#btnCancelPayment).click(function () { $(this).closest('#test').show('fast'); $(this).closest(#paymentSection).hide('fast'); });
I have an scroll view with some sophisticated animations happening during scrolling. Although after
I have a table view with some words, and i present flash-card style landscape

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.