Relative image path reference is not working in the data template of the wpf xceed busyindicator control?












2














I have refer the image using relative path reference ("pack://application:,,,/Images/LoadingBlocks.gif") as mentioned. But image not able to loaded while running the application.



if i give the absolute image path, which working fine. that is



("C:UsersDocumentsVisual Studio 2015ProjectsWpfApplication2WpfApplication2ImagesLoadingBlocks.gif)



or



("....ImagesLoadingBlocks.gif")



Please find my code snippet and sample then suggest your opinion for refer the image from the solution itself.



 <toolkit:BusyIndicator Name="BusyIndicator" Loaded="BusyIndicator_Loaded" DisplayAfter="0" IsBusy="False">
<toolkit:BusyIndicator.BusyContentTemplate>
<DataTemplate>
<StackPanel Height="100" Width="100" Margin="0" VerticalAlignment="Center" HorizontalAlignment="Center">
<MediaElement MediaEnded="myGif_MediaEnded" UnloadedBehavior="Manual" Source="pack://application:,,,/Images/LoadingBlocks.gif" LoadedBehavior="Play">
<MediaElement.OpacityMask>
<ImageBrush ImageSource="pack://application:,,,/Images/LoadingBlocks.gif"/>
</MediaElement.OpacityMask>
</MediaElement>
</StackPanel>
</DataTemplate>
</toolkit:BusyIndicator.BusyContentTemplate>
<toolkit:BusyIndicator.OverlayStyle>
<Style TargetType="Rectangle">
<Setter Property="Fill" Value="Transparent"/>
</Style>
</toolkit:BusyIndicator.OverlayStyle>
<toolkit:BusyIndicator.ProgressBarStyle>
<Style TargetType="ProgressBar">
<Setter Property="Visibility" Value="Collapsed"/>
</Style>
</toolkit:BusyIndicator.ProgressBarStyle>
<toolkit:BusyIndicator.Background>
<SolidColorBrush Color="Transparent"/>
</toolkit:BusyIndicator.Background>

</toolkit:BusyIndicator>


sample:
https://ufile.io/zdm6r



or



https://github.com/mathikp/LoadingIndicatorSample










share|improve this question
























  • Did you add the image as a resource?
    – P.Manthe
    Nov 12 at 8:16










  • As a note ..ImagesLoadingBlocks.gif is a relative path, while pack://application:,,,/Images/LoadingBlocks.gif is a WPF Pack URI, and of course absolute. That said, what exactly isn't working? Does the MediaElement not show the GIF, or does the OpacityMask not work?
    – Clemens
    Nov 12 at 8:18












  • @Clemens both media element and opacity mask not working (i.e. gif image not loading) if we given the image path as pack URI. so how to set image reference path using pack URI. I have attached sample can you please check it
    – Thirumurugan Loganathan
    Nov 12 at 8:25












  • Make sure the image file is located in a folder called Images in your Visual Studio project, and that its Build Action is set to Resource.
    – Clemens
    Nov 12 at 8:26










  • @Clemens I have set build action as Resource and also image placed in that mentioned(Images folder) location. But not working
    – Thirumurugan Loganathan
    Nov 12 at 8:28


















2














I have refer the image using relative path reference ("pack://application:,,,/Images/LoadingBlocks.gif") as mentioned. But image not able to loaded while running the application.



if i give the absolute image path, which working fine. that is



("C:UsersDocumentsVisual Studio 2015ProjectsWpfApplication2WpfApplication2ImagesLoadingBlocks.gif)



or



("....ImagesLoadingBlocks.gif")



Please find my code snippet and sample then suggest your opinion for refer the image from the solution itself.



 <toolkit:BusyIndicator Name="BusyIndicator" Loaded="BusyIndicator_Loaded" DisplayAfter="0" IsBusy="False">
<toolkit:BusyIndicator.BusyContentTemplate>
<DataTemplate>
<StackPanel Height="100" Width="100" Margin="0" VerticalAlignment="Center" HorizontalAlignment="Center">
<MediaElement MediaEnded="myGif_MediaEnded" UnloadedBehavior="Manual" Source="pack://application:,,,/Images/LoadingBlocks.gif" LoadedBehavior="Play">
<MediaElement.OpacityMask>
<ImageBrush ImageSource="pack://application:,,,/Images/LoadingBlocks.gif"/>
</MediaElement.OpacityMask>
</MediaElement>
</StackPanel>
</DataTemplate>
</toolkit:BusyIndicator.BusyContentTemplate>
<toolkit:BusyIndicator.OverlayStyle>
<Style TargetType="Rectangle">
<Setter Property="Fill" Value="Transparent"/>
</Style>
</toolkit:BusyIndicator.OverlayStyle>
<toolkit:BusyIndicator.ProgressBarStyle>
<Style TargetType="ProgressBar">
<Setter Property="Visibility" Value="Collapsed"/>
</Style>
</toolkit:BusyIndicator.ProgressBarStyle>
<toolkit:BusyIndicator.Background>
<SolidColorBrush Color="Transparent"/>
</toolkit:BusyIndicator.Background>

</toolkit:BusyIndicator>


sample:
https://ufile.io/zdm6r



or



https://github.com/mathikp/LoadingIndicatorSample










share|improve this question
























  • Did you add the image as a resource?
    – P.Manthe
    Nov 12 at 8:16










  • As a note ..ImagesLoadingBlocks.gif is a relative path, while pack://application:,,,/Images/LoadingBlocks.gif is a WPF Pack URI, and of course absolute. That said, what exactly isn't working? Does the MediaElement not show the GIF, or does the OpacityMask not work?
    – Clemens
    Nov 12 at 8:18












  • @Clemens both media element and opacity mask not working (i.e. gif image not loading) if we given the image path as pack URI. so how to set image reference path using pack URI. I have attached sample can you please check it
    – Thirumurugan Loganathan
    Nov 12 at 8:25












  • Make sure the image file is located in a folder called Images in your Visual Studio project, and that its Build Action is set to Resource.
    – Clemens
    Nov 12 at 8:26










  • @Clemens I have set build action as Resource and also image placed in that mentioned(Images folder) location. But not working
    – Thirumurugan Loganathan
    Nov 12 at 8:28
















2












2








2







I have refer the image using relative path reference ("pack://application:,,,/Images/LoadingBlocks.gif") as mentioned. But image not able to loaded while running the application.



if i give the absolute image path, which working fine. that is



("C:UsersDocumentsVisual Studio 2015ProjectsWpfApplication2WpfApplication2ImagesLoadingBlocks.gif)



or



("....ImagesLoadingBlocks.gif")



Please find my code snippet and sample then suggest your opinion for refer the image from the solution itself.



 <toolkit:BusyIndicator Name="BusyIndicator" Loaded="BusyIndicator_Loaded" DisplayAfter="0" IsBusy="False">
<toolkit:BusyIndicator.BusyContentTemplate>
<DataTemplate>
<StackPanel Height="100" Width="100" Margin="0" VerticalAlignment="Center" HorizontalAlignment="Center">
<MediaElement MediaEnded="myGif_MediaEnded" UnloadedBehavior="Manual" Source="pack://application:,,,/Images/LoadingBlocks.gif" LoadedBehavior="Play">
<MediaElement.OpacityMask>
<ImageBrush ImageSource="pack://application:,,,/Images/LoadingBlocks.gif"/>
</MediaElement.OpacityMask>
</MediaElement>
</StackPanel>
</DataTemplate>
</toolkit:BusyIndicator.BusyContentTemplate>
<toolkit:BusyIndicator.OverlayStyle>
<Style TargetType="Rectangle">
<Setter Property="Fill" Value="Transparent"/>
</Style>
</toolkit:BusyIndicator.OverlayStyle>
<toolkit:BusyIndicator.ProgressBarStyle>
<Style TargetType="ProgressBar">
<Setter Property="Visibility" Value="Collapsed"/>
</Style>
</toolkit:BusyIndicator.ProgressBarStyle>
<toolkit:BusyIndicator.Background>
<SolidColorBrush Color="Transparent"/>
</toolkit:BusyIndicator.Background>

</toolkit:BusyIndicator>


sample:
https://ufile.io/zdm6r



or



https://github.com/mathikp/LoadingIndicatorSample










share|improve this question















I have refer the image using relative path reference ("pack://application:,,,/Images/LoadingBlocks.gif") as mentioned. But image not able to loaded while running the application.



if i give the absolute image path, which working fine. that is



("C:UsersDocumentsVisual Studio 2015ProjectsWpfApplication2WpfApplication2ImagesLoadingBlocks.gif)



or



("....ImagesLoadingBlocks.gif")



Please find my code snippet and sample then suggest your opinion for refer the image from the solution itself.



 <toolkit:BusyIndicator Name="BusyIndicator" Loaded="BusyIndicator_Loaded" DisplayAfter="0" IsBusy="False">
<toolkit:BusyIndicator.BusyContentTemplate>
<DataTemplate>
<StackPanel Height="100" Width="100" Margin="0" VerticalAlignment="Center" HorizontalAlignment="Center">
<MediaElement MediaEnded="myGif_MediaEnded" UnloadedBehavior="Manual" Source="pack://application:,,,/Images/LoadingBlocks.gif" LoadedBehavior="Play">
<MediaElement.OpacityMask>
<ImageBrush ImageSource="pack://application:,,,/Images/LoadingBlocks.gif"/>
</MediaElement.OpacityMask>
</MediaElement>
</StackPanel>
</DataTemplate>
</toolkit:BusyIndicator.BusyContentTemplate>
<toolkit:BusyIndicator.OverlayStyle>
<Style TargetType="Rectangle">
<Setter Property="Fill" Value="Transparent"/>
</Style>
</toolkit:BusyIndicator.OverlayStyle>
<toolkit:BusyIndicator.ProgressBarStyle>
<Style TargetType="ProgressBar">
<Setter Property="Visibility" Value="Collapsed"/>
</Style>
</toolkit:BusyIndicator.ProgressBarStyle>
<toolkit:BusyIndicator.Background>
<SolidColorBrush Color="Transparent"/>
</toolkit:BusyIndicator.Background>

</toolkit:BusyIndicator>


sample:
https://ufile.io/zdm6r



or



https://github.com/mathikp/LoadingIndicatorSample







c# wpf xaml xceed






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 12 at 9:10

























asked Nov 12 at 7:41









Thirumurugan Loganathan

93




93












  • Did you add the image as a resource?
    – P.Manthe
    Nov 12 at 8:16










  • As a note ..ImagesLoadingBlocks.gif is a relative path, while pack://application:,,,/Images/LoadingBlocks.gif is a WPF Pack URI, and of course absolute. That said, what exactly isn't working? Does the MediaElement not show the GIF, or does the OpacityMask not work?
    – Clemens
    Nov 12 at 8:18












  • @Clemens both media element and opacity mask not working (i.e. gif image not loading) if we given the image path as pack URI. so how to set image reference path using pack URI. I have attached sample can you please check it
    – Thirumurugan Loganathan
    Nov 12 at 8:25












  • Make sure the image file is located in a folder called Images in your Visual Studio project, and that its Build Action is set to Resource.
    – Clemens
    Nov 12 at 8:26










  • @Clemens I have set build action as Resource and also image placed in that mentioned(Images folder) location. But not working
    – Thirumurugan Loganathan
    Nov 12 at 8:28




















  • Did you add the image as a resource?
    – P.Manthe
    Nov 12 at 8:16










  • As a note ..ImagesLoadingBlocks.gif is a relative path, while pack://application:,,,/Images/LoadingBlocks.gif is a WPF Pack URI, and of course absolute. That said, what exactly isn't working? Does the MediaElement not show the GIF, or does the OpacityMask not work?
    – Clemens
    Nov 12 at 8:18












  • @Clemens both media element and opacity mask not working (i.e. gif image not loading) if we given the image path as pack URI. so how to set image reference path using pack URI. I have attached sample can you please check it
    – Thirumurugan Loganathan
    Nov 12 at 8:25












  • Make sure the image file is located in a folder called Images in your Visual Studio project, and that its Build Action is set to Resource.
    – Clemens
    Nov 12 at 8:26










  • @Clemens I have set build action as Resource and also image placed in that mentioned(Images folder) location. But not working
    – Thirumurugan Loganathan
    Nov 12 at 8:28


















Did you add the image as a resource?
– P.Manthe
Nov 12 at 8:16




Did you add the image as a resource?
– P.Manthe
Nov 12 at 8:16












As a note ..ImagesLoadingBlocks.gif is a relative path, while pack://application:,,,/Images/LoadingBlocks.gif is a WPF Pack URI, and of course absolute. That said, what exactly isn't working? Does the MediaElement not show the GIF, or does the OpacityMask not work?
– Clemens
Nov 12 at 8:18






As a note ..ImagesLoadingBlocks.gif is a relative path, while pack://application:,,,/Images/LoadingBlocks.gif is a WPF Pack URI, and of course absolute. That said, what exactly isn't working? Does the MediaElement not show the GIF, or does the OpacityMask not work?
– Clemens
Nov 12 at 8:18














@Clemens both media element and opacity mask not working (i.e. gif image not loading) if we given the image path as pack URI. so how to set image reference path using pack URI. I have attached sample can you please check it
– Thirumurugan Loganathan
Nov 12 at 8:25






@Clemens both media element and opacity mask not working (i.e. gif image not loading) if we given the image path as pack URI. so how to set image reference path using pack URI. I have attached sample can you please check it
– Thirumurugan Loganathan
Nov 12 at 8:25














Make sure the image file is located in a folder called Images in your Visual Studio project, and that its Build Action is set to Resource.
– Clemens
Nov 12 at 8:26




Make sure the image file is located in a folder called Images in your Visual Studio project, and that its Build Action is set to Resource.
– Clemens
Nov 12 at 8:26












@Clemens I have set build action as Resource and also image placed in that mentioned(Images folder) location. But not working
– Thirumurugan Loganathan
Nov 12 at 8:28






@Clemens I have set build action as Resource and also image placed in that mentioned(Images folder) location. But not working
– Thirumurugan Loganathan
Nov 12 at 8:28



















active

oldest

votes











Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53257718%2frelative-image-path-reference-is-not-working-in-the-data-template-of-the-wpf-xce%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown






























active

oldest

votes













active

oldest

votes









active

oldest

votes






active

oldest

votes
















draft saved

draft discarded




















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.





Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


Please pay close attention to the following guidance:


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53257718%2frelative-image-path-reference-is-not-working-in-the-data-template-of-the-wpf-xce%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Florida Star v. B. J. F.

Error while running script in elastic search , gateway timeout

Adding quotations to stringified JSON object values