Search Results

Search found 3 results on 1 pages for 'programatique'.

Page 1/1 | 1 

  • Silverlight: Scrolling with a StackPanel

    - by programatique
    I have a grid, 3 by 3 (3 rowdefinitions and 3 columndefinitions). I want some content (a StackPanel) in one of those grid cells to scroll. I'm fairly sure this is possible but I cannot figure out how. I've tried adding ScrollViewers and Scrollbar controls to the grid cell I want to scroll, but this usually ends up creating scrolling for the entire page. Edit: My issue is more specificlly how I can get scrolling over a StackPanel. An example if the issue I am having is here: <Grid x:Name="LayoutRoot"> <Grid.ColumnDefinitions> <ColumnDefinition/> <ColumnDefinition/> </Grid.ColumnDefinitions> <Grid.RowDefinitions> <RowDefinition/> <RowDefinition/> </Grid.RowDefinitions> <Grid> <TextBlock FontSize="16">1,1</TextBlock> </Grid> <Grid Grid.Column="1"> <TextBlock FontSize="16">1,2</TextBlock> </Grid> <Grid Grid.Row="1"> <TextBlock FontSize="16">2,1</TextBlock> </Grid> <Grid Grid.Column="1" Grid.Row="1"> <StackPanel> <TextBlock>Title</TextBlock> <Grid> <ScrollViewer> <StackPanel> <TextBlock FontSize="32">2,2</TextBlock> <TextBlock FontSize="32">2,2</TextBlock> <TextBlock FontSize="32">2,2</TextBlock> <TextBlock FontSize="32">2,2</TextBlock> <TextBlock FontSize="32">2,2</TextBlock> <TextBlock FontSize="32">2,2</TextBlock> <TextBlock FontSize="32">2,2</TextBlock> <TextBlock FontSize="32">2,2</TextBlock> <TextBlock FontSize="32">2,2</TextBlock> <TextBlock FontSize="32">2,2</TextBlock> <TextBlock FontSize="32">2,2</TextBlock> <TextBlock FontSize="32">2,2</TextBlock> <TextBlock FontSize="32">2,2</TextBlock> <TextBlock FontSize="32">2,2</TextBlock> </StackPanel> </ScrollViewer> </Grid> </StackPanel> </Grid> </Grid>

    Read the article

  • Mixing Silverlight-Specific System.Xml.Linq dll with Non-Silverlight System.Xml.Linq dll

    - by programatique
    I have a Logic layer that references Silverlight's System.Xml.Linq dll and a GUI that is in WPF (hence using the non-Silverlight System.Xml.Linq dll). When I attempt to pass an XElement from GUI project to a method in the Logic project, I am getting (basically) "XElement is not of type XElement" errors. To complicate matter, I am unable to edit the Logic layer project. The Non-Silverlight DLL is at: C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\v3.5\System.Xml.Linq.dll THe Silverlight DLL is at: C:\Program Files (x86)\Microsoft SDKs\Silverlight\v3.0\Libraries\Client\System.Xml.Linq.dll I am new to C# but I'm fairly sure my issue is that I am referencing different DLL's to access the System.Xml.Linq namespace. I attempted to replace my non-Silverlight System.Xml.Linq.dll with the Silverlight's System.Xml.Linq.dll, but received assembly errors. Is there any way to resolve this short of scrapping my WPF GUI project and creating a Silverlight project?

    Read the article

  • Custom UserControl property not being set via XAML DataBinding in Silverlight 4

    - by programatique
    I have a custom user control called GoalProgressControl. Another user control contains GoalProgressControl and sets its GoalName attribute via databinding in XAML. However, the GoalName property is never set. When I check it in debug mode GoalName remains "null" for the control's lifetime. How do I set the GoalName property? Is there something I am doing incorrectly? I am using .NET Framework 4 and Silverlight 4. I am relatively new to XAML and Silverlight so any help would be greatly appreciated. I have attempted to change GoalProgressControl.GoalName into a POCO property but this causes a Silverlight error, and my reading leads me to believe that databound properties should be of type DependencyProperty. I've also simplified my code to just focus on the GoalName property (the code is below) with no success. Here is GoalProgressControl.xaml: <UserControl x:Class="GoalView.GoalProgressControl" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" DataContext="{Binding RelativeSource={RelativeSource Self}}" Height="100"> <Border Margin="5" Padding="5" BorderBrush="#999" BorderThickness="1"> <TextBlock Text="{Binding GoalName}"/> </Border> </UserControl> GoalProgressControl.xaml.cs: public partial class GoalProgressControl : UserControl, INotifyPropertyChanged { public GoalProgressControl() { InitializeComponent(); } public event PropertyChangedEventHandler PropertyChanged; public void NotifyPropertyChanged(string propertyName) { if (PropertyChanged != null) { PropertyChanged(this, new PropertyChangedEventArgs(propertyName)); } } public static DependencyProperty GoalNameProperty = DependencyProperty.Register("GoalName", typeof(string), typeof(GoalProgressControl), null); public string GoalName { get { return (String)GetValue(GoalProgressControl.GoalNameProperty); } set { base.SetValue(GoalProgressControl.GoalNameProperty, value); NotifyPropertyChanged("GoalName"); } } } I've placed GoalProgressControl on another page: <Grid Grid.Row="1" Grid.Column="1" Grid.ColumnSpan="2" Margin="5" Background="#eee" Height="200"> <Border BorderBrush="#999" BorderThickness="1" Background="White"> <StackPanel> <hgc:SectionTitleBar x:Name="ttlGoals" Title="Personal Goals" ImageSource="../Images/check.png" Uri="/Pages/GoalPage.xaml" MoreVisibility="Visible" /> <ItemsControl ItemsSource="{Binding Path=GoalItems}"> <ItemsControl.ItemTemplate> <DataTemplate> <!--TextBlock Text="{Binding Path=[Name]}"/--> <goal:GoalProgressControl GoalName="{Binding Path=[Name]}"/> </DataTemplate> </ItemsControl.ItemTemplate> </ItemsControl> </StackPanel> </Border> </Grid> Please note the commented out "TextBlock" item above. If I comment in the TextBlock and comment out the GoalProgressControl, the binding works correctly and the TextBlock shows the GoalName correctly. Also, if I replace the "GoalName" property above with a simple text string (ex "hello world"), the control renders correctly and "hello world" is shown on the control when it renders.

    Read the article

1