I am playing around with WPF and I cannot find out how to dynamically add multiple items to the Content. I need to have to TextBlocks and two images on a UserControl.
"MenuCount" and "MenuText" are two TextBlocks that are declared within the class and can be modified via properties.
The code I have so far is:
public MainPage() : base() { InitializeComponent(); DataContext = this;
MenuCount.Text = "1 of 100"; MenuCount.FontSize = 20; MenuCount.FontFamily = new System.Windows.Media.FontFamily("Courier"); MenuCount.Margin = new Thickness(500, 0, 0, 0); MenuCount.Foreground = this.FontColor;
MainContent = MenuText; MainContent = MenuCount; //This is where the code is incorrect, obviously. I need to have both of these items, and two images (not in the code yet) within this. } [/CODE]
The constant interface inconsistencies have nothing to do with anything other than their own negligence and refusal to fix it. They are lazy plain and simple. These UI inconsistencies have been there for years and not one tech at Microsoft has taken the time to fix it. It's unacceptable at this point. They keep overloading the OS with ads and garbage nobody asked for but don't fix the issues they have.
Surgie matched da Vinci precision in live trials; Unitree’s DoD listing complicates hospital adoption
Teleoperated humanoid robots completed live in-vivo surgery for the first time in medical history, UC San Diego researchers reported in Nature on July 8, 2026 — a proof of concept that could eventually extend surgical care to rural communities, battlefields, and remote settings where surgical specialists are absent. But the specific robot at the center of the breakthrough, the Unitree G1, was added to the U.S. Department of Defense's list of Chinese military companies just 30 days before the paper was published, carries a documented wormable security exploit affecting all units ever manufactured, and continuously transmits sensor data to servers in China without notifying the operator. The achievement is real, and the complications are real. Institutions evaluating this technology need to understand both.
https://www.techtimes.com/articles/320157/20260711/humanoid-robots-perform-first-live-surgery-pentagon-flags-hardware-chinese-military-tech.htm
Failed to open \EFI\ubuntu\ - Not found
That message keeps popping up every time I boot the computer. Stays there for a few seconds than vanishes and the PC loads Linux Mint, but its really annoying the hell out of me, so, does anyone here know and can tell me how to fix that or get rid of it please?
Thank you
Question
James Rose
Hello gang,
I am playing around with WPF and I cannot find out how to dynamically add multiple items to the Content. I need to have to TextBlocks and two images on a UserControl.
"MenuCount" and "MenuText" are two TextBlocks that are declared within the class and can be modified via properties.
The code I have so far is:
<UserControl x:Class="BediaMenu.MainPage"
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" d:DesignHeight="55" d:DesignWidth="458">
<StackPanel HorizontalAlignment="Left" Margin="10">
<ContentControl Content="{Binding MainContent}"/>
</StackPanel>
</UserControl>
[/CODE]
Any thoughts?
Link to comment
https://www.neowin.net/forum/topic/1045565-c-wpf-dynamically-adding-items-to-content/Share on other sites
4 answers to this question
Recommended Posts