MediaElement: PosterSource, where are you? - wpf

I am using MediaElement in my program.
<MediaElement x:Name="media" Source="MyVideo.mp4" Height="480" Width="640" HorizontalAlignment="Left" VerticalAlignment="Top" LoadedBehavior="Manual" Stretch="Fill" />
In various articles I see the possibility of using the PosterSource property in this element.
<MediaElement PosterSource="imageUri" />
This property is missing in my media. Where could there be a mistake?
P.S. I use Visual Studio Enterprise 2015. The version of .NET Framework is 4.7.2.

This function is available only in UWP applications.

Related

Need sample app using wpf, prism 6, Unity and implements a module

All samples found either address earlier version of prism or don't currently work. I am using Visual Studio 2015. I am specifically looking for an example of using ViewmodelLocator.AutoWireViewModel
There is an offical example available at GitHub: https://github.com/PrismLibrary/Prism-Samples-Wpf/tree/master/HelloWorld
This sample uses Unity and ViewA uses the view model locatator to create an instance of ViewAViewModel: https://github.com/PrismLibrary/Prism-Samples-Wpf/blob/master/HelloWorld/Modules/ModuleA/Views/ViewA.xaml
<UserControl x:Class="ModuleA.Views.ViewA"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:prism="http://prismlibrary.com/"
prism:ViewModelLocator.AutoWireViewModel="True">
<Grid>
<TextBlock Text="{Binding Title}" Foreground="Green" HorizontalAlignment="Center" VerticalAlignment="Center" FontFamily="Calibri" FontSize="24" FontWeight="Bold"></TextBlock>
</Grid>
</UserControl>

WPF borderless form using WindowGlows to create a dropshadow

So I found this while I was searching for ways to get borderless wpf forms to drop a shadow. It creates a drop shadow like that of visual studio or microsoft office. After downloading from the mentioned site, I've referenced the WindowGlows.dll file in my project and copied this code from the example on the sight.
<Window xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:WindowGlows="http://GlowWindow.codeplex.com/"
x:Class="WindowGlowsTestApp.MainWindow"
Title="MainWindow"
Height="350"
Width="525"
WindowGlows:GlowManager.EnableGlow="True"
WindowGlows:GlowManager.ActiveGlowBrush="CornflowerBlue"
WindowGlows:GlowManager.InactiveGlowBrush="LightGray">
<WindowChrome.WindowChrome>
<WindowChrome GlassFrameThickness="0"
CornerRadius="0"
CaptionHeight="36"
ResizeBorderThickness="0" />
</WindowChrome.WindowChrome>
<Border BorderThickness="1"
BorderBrush="{Binding Path=(WindowGlows:GlowManager.ActiveGlowBrush),RelativeSource={RelativeSource Mode=FindAncestor,AncestorType=Window}}">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="36" />
<RowDefinition />
<RowDefinition Height="24" />
</Grid.RowDefinitions>
<Rectangle Fill="{Binding Path=(WindowGlows:GlowManager.ActiveGlowBrush),RelativeSource={RelativeSource Mode=FindAncestor,AncestorType=Window}}"
Margin="-1,11,-1,0"
StrokeThickness="0"
ClipToBounds="True" />
<TextBlock HorizontalAlignment="Center"
VerticalAlignment="Center"
Text="{Binding Title, RelativeSource={RelativeSource AncestorType={x:Type Window}, Mode=FindAncestor}}"
Foreground="{Binding Path=(WindowGlows:GlowManager.InactiveGlowBrush),RelativeSource={RelativeSource Mode=FindAncestor,AncestorType=Window}}"
Margin="0,11,0,0" />
<Rectangle Grid.Row="2"
Fill="{Binding Path=(WindowGlows:GlowManager.ActiveGlowBrush),RelativeSource={RelativeSource Mode=FindAncestor,AncestorType=Window}}"
Margin="-1,0,-1,-1"
StrokeThickness="0"
ClipToBounds="True" />
</Grid>
</Border>
When I click start, the form drops a fantastic shadow and I can put this to great use but I can't get rid of the errors, which tell me
Error 1 The name "GlowManager" does not exist in the namespace
I get 6 more errors about glow manager but nothing else, how do I correct the namespace?
After reading this link I copied the entire project straight into the root of my C drive and opened it from there, it works absolutely fine now. Looks like it's a visual studio bug if anything.
That namespace doesn't look right to me.
Assuming you have availed reference in your project to the doll, the easiest way to get these right is to use blend, from assets tab drop in a object from that DSL and it will do the rest. visual studio is a little less helpful.
Without seeing exactly what you've got, the best I can offer is change the namespace tag to something of this form...
Xmlns:windowchrome="clr-namespace:<namespace of targeted objects>,assembly=<assembly name as seen in references folder>"
msdn includes some more details, http://msdn.microsoft.com/en-gb/library/bb514546%28v=vs.90%29.aspx

VB.NET WPF Ribbon 2010 .net 4.0 does not work 3.5 does

I just installed Microsoft Ribbon for WPF 2010 on 2 different windows 7 boxes. If I make a .net 3.5 project it works fine but a .net 4.0 it does not.
I can load the sample ribbon application and it works but when I drag the ribbon controls over they just make a transparent box.
I notice it does not make the XAML correct. Here is the code, 4.0 on top then 3.5 below it. Is there some setting or option I need to change?
<ribbon:Ribbon Height="136" HorizontalAlignment="Left" Name="Ribbon1" VerticalAlignment="Top" Width="618" />
<ribbon:RibbonGroup Height="100" HorizontalAlignment="Left" Margin="72,36,0,0" Name="RibbonGroup1" VerticalAlignment="Top" Width="200" />
<ribbon:RibbonTab Grid.RowSpan="2" Height="100" HorizontalAlignment="Left" Margin="96,50,0,0" Name="RibbonTab1" VerticalAlignment="Top" Width="200" />
<ribbon:RibbonGroup Grid.RowSpan="2" Height="100" HorizontalAlignment="Left" Margin="156,80,0,0" Name="RibbonGroup2" VerticalAlignment="Top" Width="200" />
<my:Ribbon Height="139" HorizontalAlignment="Left" Name="Ribbon1" VerticalAlignment="Top" Width="503">
<my:RibbonTab Header="Tab" Name="RibbonTab1">
<my:RibbonGroup Header="Group" Name="RibbonGroup1">
<my:RibbonButton Label="Button" Name="RibbonButton1" />
</my:RibbonGroup>
</my:RibbonTab>
</my:Ribbon>
The Microsoft Ribbon control (Oct 2010 release) is a joke. They got it working..."mostly" and then left it full of bugs without fixing them. "It will work properly in the next version of Visual Studio"...um, okay.
I tried to use it and was constantly frustrated. DevComponents has a pretty solid Ribbon control for WPF. I recommend it. But I still have a couple of issues with that one, too.
Good luck!

Office ribbon for WPF 4.0

It is rumoured that WPF 4.0 would deliver us an out-of-the-box Office Ribbon.
A new WPF Ribbon Control will be
available for download shortly after
the release of WPF 4. [1]
Now my internet and MSDN search turned out to be fruitless, and as far as I know, it would be release after the .NET 4.0 framework would launch. My search lead me to the Office plugin ribbon controls and the CTP prereleased before the release of .net 4.0 with a limited featureset.
So my question is: does anyone know if and when Microsoft will release this Office Ribbon with the framework? Or if they don't a nice press note saying that they ditched the project.
Also if anyone has experience with the Ribbon I'm talking about, will this Ribbon work in a partial trusted environment?
My thanks will be ever lasting! ;)
This may be old news to you now but there wasn't a selected answer so here you go:
http://msdn.microsoft.com/en-us/library/ff799534.aspx
You can download the source, examples, and assemblies for including a ribbon. The documentation can be found on MSDN at http://msdn.microsoft.com/en-us/library/microsoft.windows.controls.ribbon.aspx.
Simple example from a project that includes the 4.0 version of the RibbonControlsLibrary.dll
<Window x:Class="WpfRibbonApplication1.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:ribbon="clr-namespace:Microsoft.Windows.Controls.Ribbon;assembly=RibbonControlsLibrary"
Title="MainWindow"
x:Name="RibbonWindow"
Width="640" Height="480">
<Grid x:Name="LayoutRoot">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<ribbon:Ribbon x:Name="Ribbon" Title="Ribbon Title">
<ribbon:Ribbon.HelpPaneContent>
<ribbon:RibbonButton SmallImageSource="Icon.ico" />
</ribbon:Ribbon.HelpPaneContent>
<ribbon:Ribbon.QuickAccessToolBar>
<ribbon:RibbonQuickAccessToolBar >
<ribbon:RibbonButton x:Name="QATButton1"
SmallImageSource="Icon.ico" />
<ribbon:RibbonButton x:Name="QATButton2"
SmallImageSource="Icon.ico" />
</ribbon:RibbonQuickAccessToolBar>
</ribbon:Ribbon.QuickAccessToolBar>
<ribbon:Ribbon.ApplicationMenu>
<ribbon:RibbonApplicationMenu SmallImageSource="Icon.ico">
<ribbon:RibbonApplicationMenuItem Header="Hello _Ribbon"
x:Name="MenuItem1"
ImageSource="Icon.ico"/>
</ribbon:RibbonApplicationMenu>
</ribbon:Ribbon.ApplicationMenu>
<ribbon:RibbonTab x:Name="HomeTab"
Header="Home">
<ribbon:RibbonGroup x:Name="Group1"
Header="Group1">
<ribbon:RibbonButton x:Name="Button1"
LargeImageSource="Icon.ico"
Label="Button1" />
<ribbon:RibbonButton x:Name="Button2"
SmallImageSource="Icon.ico"
Label="Button2" />
<ribbon:RibbonButton x:Name="Button3"
SmallImageSource="Icon.ico"
Label="Button3" />
<ribbon:RibbonButton x:Name="Button4"
SmallImageSource="Icon.ico"
Label="Button4" />
</ribbon:RibbonGroup>
</ribbon:RibbonTab>
</ribbon:Ribbon>
</Grid>
</Window>
Produces something that looks like this:
Have you seen the WPF 3.5 ribbon?
It should work in partial trust unless they make a huge mistake :). Things not allowed in partial trust are:
Connecting directly to SQL
Reflection
a few other things
Shouldn't be doing that sort of thing in a UserControl (even if it is a bit fancy...)

Error about UserControl not supported in WPF in Expression Blend 2

I've created a test Silverlight 2 app in Visual Studio, just copying the Tim Heuer video, but when I go to open it in Blend I get this error
UserControl is not supported in a Windows Presentation Foundation (WPF) project
This is the XAML code
<UserControl x:Class="MyFirstApp.Page"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Width="400" Height="300">
<Grid x:Name="LayoutRoot" Background="White">
<StackPanel Orientation="Vertical">
<TextBox x:Name="myTextBox" FontSize="60" />
<Button Content="Click Me" FontSize="60" Click="Button_Click" />
</StackPanel>
</Grid>
</UserControl>
Am I missing a reference or something?
You need to install Expression Blend 2.0 SP1.
Please take a look at this thread:
http://social.expression.microsoft.com/Forums/en-US/blend/thread/33030347-c99a-4f41-8be7-089c92e4ab2d

Resources