2016-06-11 5 views
0

Я пытаюсь показать Toast (not tile) Уведомление из настольного приложения. (C#) Без групп все в порядке, я вижу текст и изображение, но группы (подгруппы) скрыты. Почему?уведомление в Windows 10 (winrt + рабочий стол) Не работает подгруппа

Я создаю xml через NotificationsExtensions.Win10 Я отправлю исходный xml, если потребуется. Спасибо.

`

<?xml version="1.0" encoding="utf-8"?> 
<toast launch="https://toster.ru/q/327775?e=3995419#comment_1108015"> 
    <visual> 
    <binding template="ToastGeneric"> 
     <text>Today will be mostly sunny with a high of 63 and a low of 42.</text> 
     <group> 
     <subgroup hint-weight="1"> 
      <text hint-align="center">Mon</text> 
      <image src="file:///C:/Users/user/documents/visual studio 2015/Projects/android.forms.test/Lobster.Home.Toster.ru.Windows/bin/Debug/images/icon_activity_comment.png" hint-removeMargin="true" /> 
      <text hint-align="center">63°</text> 
      <text hint-align="center" hint-style="captionSubtle">42°</text> 
     </subgroup> 
     <subgroup hint-weight="1"> 
      <text hint-align="center">Tue</text> 
      <image src="file:///C:/Users/user/documents/visual studio 2015/Projects/android.forms.test/Lobster.Home.Toster.ru.Windows/bin/Debug/images/icon_activity_comment.png" hint-removeMargin="true" /> 
      <text hint-align="center">57°</text> 
      <text hint-align="center" hint-style="captionSubtle">38°</text> 
     </subgroup> 
     <subgroup hint-weight="1"> 
      <text hint-align="center">Wed</text> 
      <image src="file:///C:/Users/user/documents/visual studio 2015/Projects/android.forms.test/Lobster.Home.Toster.ru.Windows/bin/Debug/images/icon_activity_comment.png" hint-removeMargin="true" /> 
      <text hint-align="center">59°</text> 
      <text hint-align="center" hint-style="captionSubtle">43°</text> 
     </subgroup> 
     <subgroup hint-weight="1"> 
      <text hint-align="center">Thu</text> 
      <image src="file:///C:/Users/user/documents/visual studio 2015/Projects/android.forms.test/Lobster.Home.Toster.ru.Windows/bin/Debug/images/icon_activity_comment.png" hint-removeMargin="true" /> 
      <text hint-align="center">62°</text> 
      <text hint-align="center" hint-style="captionSubtle">42°</text> 
     </subgroup> 
     <subgroup hint-weight="1"> 
      <text hint-align="center">Fri</text> 
      <image src="file:///C:/Users/user/documents/visual studio 2015/Projects/android.forms.test/Lobster.Home.Toster.ru.Windows/bin/Debug/images/icon_activity_comment.png" hint-removeMargin="true" /> 
      <text hint-align="center">71°</text> 
      <text hint-align="center" hint-style="captionSubtle">66°</text> 
     </subgroup> 
     </group> 
    </binding> 
    </visual> 
</toast> 

`

ответ

0

Вы можете использовать это удивительное приложение, чтобы проверить свои Тосты и увидеть его, прежде чем отправить его и установить данные XML: Notifications Visualizer - Windows Store

Для вашей проблемы, Я считаю, что это распространенная проблема, когда вы пропустили закрывающий тег или ваш код кода xml для визуальных изображений неправильный, решение заключается в использовании приложения Visualizer Visualizer.

Update 1:

Поскольку вы не можете загрузить приложение, вот код XML они использовали .. Я попробовал его на моей машине, и это хорошо выглядеть:

Weather Toast

<toast> 

    <visual baseUri="Assets/Apps/Weather/"> 
     <binding template="ToastGeneric"> 
      <text>Today will be sunny with a high of 63 and a low of 42.</text> 

      <group> 
       <subgroup hint-weight="1"> 
        <text hint-align="center">Mon</text> 
        <image src="Mostly Cloudy.png" hint-removeMargin="true"/> 
        <text hint-align="center">63°</text> 
        <text hint-style="captionsubtle" hint-align="center">42°</text> 
       </subgroup> 
       <subgroup hint-weight="1"> 
        <text hint-align="center">Tue</text> 
        <image src="Cloudy.png" hint-removeMargin="true"/> 
        <text hint-align="center">57°</text> 
        <text hint-style="captionsubtle" hint-align="center">38°</text> 
       </subgroup> 
       <subgroup hint-weight="1"> 
        <text hint-align="center">Wed</text> 
        <image src="Sunny.png" hint-removeMargin="true"/> 
        <text hint-align="center">59°</text> 
        <text hint-style="captionsubtle" hint-align="center">43°</text> 
       </subgroup> 
       <subgroup hint-weight="1"> 
        <text hint-align="center">Thu</text> 
        <image src="Sunny.png" hint-removeMargin="true"/> 
        <text hint-align="center">62°</text> 
        <text hint-style="captionsubtle" hint-align="center">42°</text> 
       </subgroup> 
       <subgroup hint-weight="1"> 
        <text hint-align="center">Fri</text> 
        <image src="Sunny.png" hint-removeMargin="true"/> 
        <text hint-align="center">71°</text> 
        <text hint-style="captionsubtle" hint-align="center">66°</text> 
       </subgroup> 
      </group> 
     </binding> 
    </visual> 

</toast> 

BTW, я пробовал ваш XML-код в приложении Visualizer и ничего не показывал! Попробуйте настроить код xml, который я предоставил, в соответствии с вашими потребностями ...

+0

Да, я знаю, спасибо. Но Windows Store не работает на этом компьютере, я не могу установить какое-либо приложение? Я попробую его позже из другого. Я использую пример с погодой, группы скрыты –

+0

Я обновил свой ответ, не могли бы вы попробовать? –

+0

Чтобы использовать мой код, вам нужно изменить пути изображения, когда я использую неправильные пути, я получаю уведомление по умолчанию Text, когда я использую правильные пути изображения, я получаю текст без подгрупп. Я показываю nitifications из приложения WPF COMMON DESKTOP, а не из приложения магазина Windows. Разница между вашим и моим кодом - только изображения. –

Смежные вопросы